Method PostWRJobOrderStatusUpdate

Summary

PostWRJobOrderStatusUpdate

Remarks

Work request/job order status update - This API currently provides the ability to update either the work request or job order status. For example, it can be used to cancel, complete, or close a work request or job order, along with various other status update capabilities. Valid work request statuses:• ‘AS’ – Assigned• ‘AU’ - Authorized• ‘CA’ – Canceled• ‘CL’ – Closed• ‘CO’ – Completed• ‘HD’ – Held for deposit• ‘HO’ – On hold• ‘OP’ - OpenValid job order statuses:• ‘CA’ – Canceled• ‘CL’ – Closed• ‘CO’ – Completed• ‘IS’ – Issued(printed)• ‘RD’ – Ready• ‘SD’ - Scheduled,. Only a single job order or work request can be updated. Updating the work request status may require updating the job order status first in certain instances. System business rules may prevent the status from being updated, in which case an error(s) will be sent back indicating why the update was not performed.

Requires

Input Parameters

NameTypeLengthDescription
workReqNbr System.String 9 [Required] Work Request Number
reqStatus System.String 2 [Required] Requested status change for work request or job order (see remarks)
statusChgDate System.String 8 [Required] Status change date (numeric – YYYYMMDD) – used to update pertinent associated dates for requested status change action, i.e., for completion it will be used for the actual completion date, for close it will be used for the close date, etc.
jobOrderNbr System.String 3 [Required] Job order number (numeric) – required when updating the status of a job order. Should be zero when requesting to update the status of work request.
spawnJobOrder System.String 3 Must be specified if you want base configuration to be applied (‘Yes’). Any value other than ‘Yes’ will cause the base configuration to be ignored. Values: Yes/No
print System.String 3 Required when status is “IS”. Values: Yes/No
actualCompletionTIme System.String 6 Actual completion time (numeric – military time) Note: May be required by request category.
actionTaken System.String 4 Action taken. Note: May be required by request category. Note: A value of ‘*’ should be sent if you wish to blank out this value.
actualStartDate System.String 8 Actual start date (numeric – YYYYMMDD). Note: May be required by request category.
actualStartTime System.String 6 Actual completion time (numeric – military time). Note: May be required by request category.
uopCode System.String 6 UOP code. Note: A value of ‘*’ should be sent if you wish to blank out this value.
uopQuantity System.String 9 UOP quantity
relatedWRNbr System.String 9 Related work request number. Note: A value of ‘*’ should be sent if you wish to blank out this value.
unitizationMethod System.String 1 Unitization method. Note: A value of ‘*’ should be sent if you wish to blank out this value.
depRateCode System.String 3 Depreciation rate code. Note: A value of ‘*’ should be sent if you wish to blank out this value.
depConvention System.String 1 Depreciation convention. Note: A value of ‘*’ should be sent if you wish to blank out this value.
subAcctGroup System.String 2 Subaccount group. Note: A value of ‘*’ should be sent if you wish to blank out this value.
subAcct System.String 5 Subaccount. Note: A value of ‘*’ should be sent if you wish to blank out this value.
genMiscCharge System.String 3 Generate miscellaneous charge – If not supplied (blank) during the completion process then the default will be used to generate the miscellaneous charge when pre-defined, otherwise no charge would be generated. Values: Yes/No. NOTE: Not applicable for non-CIS work requests. Only applicable on complete or close of a work request.
resultComments System.String 5000 Result comments
billWR System.String 3 Bill work request. Values: Yes/No.
miscChargeCode System.String 2 CIS miscellaneous charge code. Note: A value of ‘*’ should be sent if you wish to blank out this value.
miscChargeAmt System.String 11 CIS miscellaneous charge amount.

Example

POST http://localhost/FusionServices/v3/Naviline/WorkOrders/WRJobOrderStatusUpdate

Return Values

NameDescription
OUT_ERRCDE 0000
OUT_ERRDSC Work request/job order, WF0180937/1, status was updated.

Sample Responses

Sample Code

using System.Net;
using Newtonsoft.Json.Linq;

public void MethodName(parms)
{
   string uri = "http://localhost/FusionServices/v3/Naviline/WorkOrders/WRJobOrderStatusUpdate";
   System.Collections.Specialized.NameValueCollection postParms = 
     new System.Collections.Specialized.NameValueCollection(); 
   // Set paramater values
   postParms.Add("workReqNbr",System.Web.HttpUtility.UrlEncode("WF0180937"));
   postParms.Add("reqStatus",System.Web.HttpUtility.UrlEncode("RD"));
   postParms.Add("statusChgDate",System.Web.HttpUtility.UrlEncode("20220712"));
   postParms.Add("jobOrderNbr",System.Web.HttpUtility.UrlEncode("1"));

   WebClient req = new WebClient();
   wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
   wc.Headers.Set("X-APPID", "YOURID");
   wc.Headers.Set("X-APPKEY", "YOURKEY");

   byte[] responseBytes = wc.UploadValues(new Uri(uri), "POST", postParms);
   string stringResult = Encoding.UTF8.GetString(responseBytes); 
   JObject response = JObject.Parse(stringResult);
   string error = response["OutputParms"]["ErrorCode"].ToString();
   if (error == "0000")
   {
         // TODO - YOUR CODE HERE
   }
}

C# Razor MVC Sample Code

using System;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Collections.Specialized;
using FusionServiceHelper.Models;

// NOTE: Use the namespace generated when you add the class, so that it is correct.
namespace FusionRazor.Models
{
   public class PostWRJobOrderStatusUpdate
   {
       // Add property for each input param in order to map a field to it
       [Required(ErrorMessage = "Required")]
       [RegularExpression("^(?=.{0,9}$).*", ErrorMessage = "Must be 9 characters or less. ")]
       public string workReqNbr{get; set;}

       [Required(ErrorMessage = "Required")]
       [RegularExpression("^(?=.{0,2}$).*", ErrorMessage = "Must be 2 characters or less. ")]
       public string reqStatus{get; set;}

       [Required(ErrorMessage = "Required")]
       [RegularExpression("^(?=.{0,8}$).*", ErrorMessage = "Must be 8 characters or less. ")]
       public string statusChgDate{get; set;}

       [Required(ErrorMessage = "Required")]
       [RegularExpression("^(?=.{0,3}$).*", ErrorMessage = "Must be 3 characters or less. ")]
       public string jobOrderNbr{get; set;}

       [RegularExpression("^(?=.{0,3}$).*", ErrorMessage = "Must be 3 characters or less. ")]
       public string spawnJobOrder{get; set;}

       [RegularExpression("^(?=.{0,3}$).*", ErrorMessage = "Must be 3 characters or less. ")]
       public string print{get; set;}

       [RegularExpression("^(?=.{0,6}$).*", ErrorMessage = "Must be 6 characters or less. ")]
       public string actualCompletionTIme{get; set;}

       [RegularExpression("^(?=.{0,4}$).*", ErrorMessage = "Must be 4 characters or less. ")]
       public string actionTaken{get; set;}

       [RegularExpression("^(?=.{0,8}$).*", ErrorMessage = "Must be 8 characters or less. ")]
       public string actualStartDate{get; set;}

       [RegularExpression("^(?=.{0,6}$).*", ErrorMessage = "Must be 6 characters or less. ")]
       public string actualStartTime{get; set;}

       [RegularExpression("^(?=.{0,6}$).*", ErrorMessage = "Must be 6 characters or less. ")]
       public string uopCode{get; set;}

       [RegularExpression("^(?=.{0,9}$).*", ErrorMessage = "Must be 9 characters or less. ")]
       public string uopQuantity{get; set;}

       [RegularExpression("^(?=.{0,9}$).*", ErrorMessage = "Must be 9 characters or less. ")]
       public string relatedWRNbr{get; set;}

       [RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
       public string unitizationMethod{get; set;}

       [RegularExpression("^(?=.{0,3}$).*", ErrorMessage = "Must be 3 characters or less. ")]
       public string depRateCode{get; set;}

       [RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
       public string depConvention{get; set;}

       [RegularExpression("^(?=.{0,2}$).*", ErrorMessage = "Must be 2 characters or less. ")]
       public string subAcctGroup{get; set;}

       [RegularExpression("^(?=.{0,5}$).*", ErrorMessage = "Must be 5 characters or less. ")]
       public string subAcct{get; set;}

       [RegularExpression("^(?=.{0,3}$).*", ErrorMessage = "Must be 3 characters or less. ")]
       public string genMiscCharge{get; set;}

       [RegularExpression("^(?=.{0,5000}$).*", ErrorMessage = "Must be 5000 characters or less. ")]
       public string resultComments{get; set;}

       [RegularExpression("^(?=.{0,3}$).*", ErrorMessage = "Must be 3 characters or less. ")]
       public string billWR{get; set;}

       [RegularExpression("^(?=.{0,2}$).*", ErrorMessage = "Must be 2 characters or less. ")]
       public string miscChargeCode{get; set;}

       [RegularExpression("^(?=.{0,11}$).*", ErrorMessage = "Must be 11 characters or less. ")]
       public string miscChargeAmt{get; set;}

       public PostWRJobOrderStatusUpdate()
       {
           //Set any defaults here
       }
   }
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the PostWRJobOrderStatusUpdate class. *@
@* NOTE: Select Edit as the Scaffold template. *@
@* NOTE: Use the @model line that is generated at the top.  Replace the rest with the lines below.
@model FusionRazor.Models.PostWRJobOrderStatusUpdate

@{
   ViewBag.Title = "PostWRJobOrderStatusUpdate";
}

<h2>PostWRJobOrderStatusUpdate</h2>
@using (Html.BeginForm()) {
   @Html.AntiForgeryToken()
   @Html.ValidationSummary(true)
   <fieldset>
   <legend>PostWRJobOrderStatusUpdate</legend>
       <div class="editor-label">
           @Html.LabelFor(model => model.workReqNbr)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.workReqNbr)
           @Html.ValidationMessageFor(model => model.workReqNbr)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.reqStatus)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.reqStatus)
           @Html.ValidationMessageFor(model => model.reqStatus)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.statusChgDate)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.statusChgDate)
           @Html.ValidationMessageFor(model => model.statusChgDate)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.jobOrderNbr)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.jobOrderNbr)
           @Html.ValidationMessageFor(model => model.jobOrderNbr)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.spawnJobOrder)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.spawnJobOrder)
           @Html.ValidationMessageFor(model => model.spawnJobOrder)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.print)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.print)
           @Html.ValidationMessageFor(model => model.print)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.actualCompletionTIme)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.actualCompletionTIme)
           @Html.ValidationMessageFor(model => model.actualCompletionTIme)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.actionTaken)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.actionTaken)
           @Html.ValidationMessageFor(model => model.actionTaken)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.actualStartDate)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.actualStartDate)
           @Html.ValidationMessageFor(model => model.actualStartDate)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.actualStartTime)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.actualStartTime)
           @Html.ValidationMessageFor(model => model.actualStartTime)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.uopCode)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.uopCode)
           @Html.ValidationMessageFor(model => model.uopCode)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.uopQuantity)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.uopQuantity)
           @Html.ValidationMessageFor(model => model.uopQuantity)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.relatedWRNbr)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.relatedWRNbr)
           @Html.ValidationMessageFor(model => model.relatedWRNbr)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.unitizationMethod)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.unitizationMethod)
           @Html.ValidationMessageFor(model => model.unitizationMethod)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.depRateCode)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.depRateCode)
           @Html.ValidationMessageFor(model => model.depRateCode)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.depConvention)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.depConvention)
           @Html.ValidationMessageFor(model => model.depConvention)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.subAcctGroup)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.subAcctGroup)
           @Html.ValidationMessageFor(model => model.subAcctGroup)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.subAcct)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.subAcct)
           @Html.ValidationMessageFor(model => model.subAcct)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.genMiscCharge)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.genMiscCharge)
           @Html.ValidationMessageFor(model => model.genMiscCharge)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.resultComments)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.resultComments)
           @Html.ValidationMessageFor(model => model.resultComments)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.billWR)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.billWR)
           @Html.ValidationMessageFor(model => model.billWR)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.miscChargeCode)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.miscChargeCode)
           @Html.ValidationMessageFor(model => model.miscChargeCode)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.miscChargeAmt)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.miscChargeAmt)
           @Html.ValidationMessageFor(model => model.miscChargeAmt)
       </div>
       <p>
       <input type="submit" value="Submit"/>
       </p>
   </fieldset>

}

@section Scripts {
   @Scripts.Render("~/bundles/jqueryval")
}
using System;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FusionServiceHelper.Models;

// NOTE: Replace 'MyController' with the name of your controller.

// 
// GET: /MyController/PostWRJobOrderStatusUpdate
public ActionResult PostWRJobOrderStatusUpdate()
{
   // Create a new instance of the model to pick up any default values.
   PostWRJobOrderStatusUpdate model =  new PostWRJobOrderStatusUpdate();

   // pass model to set to default values
   // NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
   return View("~/Views/MyFolderPath/PostWRJobOrderStatusUpdate.cshtml", model);
}

// 
// POST: /MyController/PostWRJobOrderStatusUpdate
[HttpPost]
public ActionResult PostWRJobOrderStatusUpdate(FormCollection collection)
{
   string url = "v3/Naviline/WorkOrders/WRJobOrderStatusUpdate";
   // Get the value from each input field
   NameValueCollection inputParms = new NameValueCollection();
   inputParms.Add("workReqNbr", collection["workReqNbr"]);
   inputParms.Add("reqStatus", collection["reqStatus"]);
   inputParms.Add("statusChgDate", collection["statusChgDate"]);
   inputParms.Add("jobOrderNbr", collection["jobOrderNbr"]);
   inputParms.Add("spawnJobOrder", collection["spawnJobOrder"]);
   inputParms.Add("print", collection["print"]);
   inputParms.Add("actualCompletionTIme", collection["actualCompletionTIme"]);
   inputParms.Add("actionTaken", collection["actionTaken"]);
   inputParms.Add("actualStartDate", collection["actualStartDate"]);
   inputParms.Add("actualStartTime", collection["actualStartTime"]);
   inputParms.Add("uopCode", collection["uopCode"]);
   inputParms.Add("uopQuantity", collection["uopQuantity"]);
   inputParms.Add("relatedWRNbr", collection["relatedWRNbr"]);
   inputParms.Add("unitizationMethod", collection["unitizationMethod"]);
   inputParms.Add("depRateCode", collection["depRateCode"]);
   inputParms.Add("depConvention", collection["depConvention"]);
   inputParms.Add("subAcctGroup", collection["subAcctGroup"]);
   inputParms.Add("subAcct", collection["subAcct"]);
   inputParms.Add("genMiscCharge", collection["genMiscCharge"]);
   inputParms.Add("resultComments", collection["resultComments"]);
   inputParms.Add("billWR", collection["billWR"]);
   inputParms.Add("miscChargeCode", collection["miscChargeCode"]);
   inputParms.Add("miscChargeAmt", collection["miscChargeAmt"]);

   try
   {
       // Send the request
       FusionServiceRequest request = new FusionServiceRequest();
       FusionServiceResult result = request.Post(url, inputParms);

       return View("Result", result);
   }
   catch(Exception e)
   {
       HandleErrorInfo info = new HandleErrorInfo(e, "MyController", "PostWRJobOrderStatusUpdate");
       return View("Error", info);
   }
}