Method PostJobOrderSync

Summary

PostJobOrderSync

Remarks

Incremental pertains to all activity recorded on the primary file information of both the work requests (WFABCPP) and/or job orders (WFALREP) since the last incremental sync process was performed based on the last change information in the two files. Data in incremental syncs may be reported twice for days on which the sync is performed. Scheduling last in the day would reduce this possibility.

Requires

Input Parameters

NameTypeLengthDescription
syncType System.String 1 [Required] F=Full Sync; I=Incremental Sync

Example

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

Return Values

NameDescription
OUT_ERRCDE Error Code: 0000 or 0001
OUT_ERRDSC Error Description: Success or Error = Invalid environment parameters
REQUESTNBR Work request number – ‘WF01234567’
JOBNBR Job order number – ‘001’ (numeric)
REQCATG Work request category
WORKTYPE Work type
REQORIGIN Request Origin
SHORTDSC Short DescriptionWork request status (text) – description derived from ABADCD status code value
REQSTATUS Work request status (text) – description derived from ABADCD status code value
REQSTSCDE Work request status code • ‘AS’ – Assigned • ‘AU’ - Authorized • ‘CA’ – Canceled • ‘CL’ – Closed • ‘CO’ – Completed • ‘HD’ – Held for deposit • ‘HO’ – On hold • ‘OP’ - Open
CUSTOMERID CIS customer ID (numeric)
REQNAME Requestor name
REQDEPT Requesting department
REQPRIORITY Request priority
LOCATIONID Location ID (numeric)
GENLOC General location
WRSCHSTRDTE W/R scheduled start date – YYYYMMDD (numeric)
WRSCHCMPDTE W/R scheduled completion date – YYYYMMDD (numeric)
WRACTSTRDTE W/R actual start date – YYYYMMDD (numeric)
WRACTCMPDTE W/R actual completion date – YYYYMMDD (numeric)
WRPRJNBR W/R project number
ASSIGNDEPT W/R assigned department
WRUOP W/R UOP code
WRUOPQTY W/R UOP quantity – ‘12345.123’ (numeric)
RLTDREQ Related request number – ‘WF01234567’
UNITIZMTHD Unitization methodL • ‘ ‘ – Not specified • ‘C’ – Cost • ‘H’ - Hours
DEPRTECDE Depreciation rate code
DEPRECCONV Depreciation convention: • ‘H’ - 50% Install/50% Retire • ‘I’ - 100% for install month • ‘R’ - 100% for retire month
SUBACCTGRP Subaccount group
SUBACCT Subaccount
WRXCOORD W/R X-coordinate (numeric) – ‘1234567890.123456’
WRYCOORD W/R Y-coordinate (numeric) – ‘1234567890.123456’
WRZCOORD W/R Z-coordinate (numeric) – ‘123456789.12’
WRREQDTE W/R request date – YYYYMMDD (numeric)
WRKREQGRP Work request group: • ‘CP’ – Capital • ‘UC’ – Utility capital • ‘UT’ – Utility non-capital • ‘WF’ – Non-capital non-utility
CHGTODEPT Charge to department
CATG J/O request category
TASK Task
STDTASK Standard Task
JODESC Job Order Description
SERVICE Service
SVCSEQ Service sequence – ‘000’ (numeric)
METERNBR Meter Number
CREW Crew
JOSCHSTRDTE J/O scheduled start date – YYYYMMDD (numeric)
JOSCHCMPDTE J/O scheduled completion date – YYYYMMDD (numeric)
JOACTSTRDTE J/O actual start date – YYYYMMDD (numeric)
JOACTCMPDTE J/O actual completion date – YYYYMMDD (numeric)
JOSTATUS Job order status (text)
JOSTSCDE Job order status code: • ‘CA’ – Canceled • ‘CL’ – Closed • ‘CO’ – Completed • ‘IS’ – Issued(printed) • ‘RD’ – Ready • ‘SD’ - Scheduled
DISPATCHBY Dispatched by (user ID)
DISPATCHTO Dispatched to employee ID (numeric)
DISPATCHDTE Dispatched date – YYYYMMDD (numeric)
DISPATCHTIM Dispatched time – HHMMSS (military time)
JOUOP J/O UOP code
JOUOPQTY J/O UOP quantity – ‘12345.123’ (numeric)
JODEPT J/O assigned department
JOPROJNBR J/O project number
JOXCOORD J/O X-coordinate (numeric) – ‘1234567890.123456’
JOYCOORD J/O Y-coordinate (numeric) – ‘1234567890.123456’
JOZCOORD J/O Z-coordinate (numeric) – ‘123456789.12’
DFTPRACCT Default payroll account
DFTPIACCT Default purchasing/inventory account
DFTPOACCT Default purchase order account
DFTPCACCT Default p-card account (future)
NEWMTRNBR New meter number

Sample Responses

Sample Code

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

public void MethodName(parms)
{
   string uri = "http://localhost/FusionServices/v3/Naviline/WorkOrders/JobOrderSync";
   System.Collections.Specialized.NameValueCollection postParms = 
     new System.Collections.Specialized.NameValueCollection(); 
   // Set paramater values
   postParms.Add("syncType",System.Web.HttpUtility.UrlEncode("F"));

   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")
   {
        JArray jRows = (JArray)response["Rows"];
        foreach (JObject row in jRows)
        {
             string REQUESTNBR = row["REQUESTNBR"].ToString();
             string JOBNBR = row["JOBNBR"].ToString();
             string REQCATG = row["REQCATG"].ToString();
             string WORKTYPE = row["WORKTYPE"].ToString();
             string REQORIGIN = row["REQORIGIN"].ToString();
             string SHORTDSC = row["SHORTDSC"].ToString();
             string REQSTATUS = row["REQSTATUS"].ToString();
             string REQSTSCDE = row["REQSTSCDE"].ToString();
             string CUSTOMERID = row["CUSTOMERID"].ToString();
             string REQNAME = row["REQNAME"].ToString();
             string REQDEPT = row["REQDEPT"].ToString();
             string REQPRIORITY = row["REQPRIORITY"].ToString();
             string LOCATIONID = row["LOCATIONID"].ToString();
             string GENLOC = row["GENLOC"].ToString();
             string WRSCHSTRDTE = row["WRSCHSTRDTE"].ToString();
             string WRSCHCMPDTE = row["WRSCHCMPDTE"].ToString();
             string WRACTSTRDTE = row["WRACTSTRDTE"].ToString();
             string WRACTCMPDTE = row["WRACTCMPDTE"].ToString();
             string WRPRJNBR = row["WRPRJNBR"].ToString();
             string ASSIGNDEPT = row["ASSIGNDEPT"].ToString();
             string WRUOP = row["WRUOP"].ToString();
             string WRUOPQTY = row["WRUOPQTY"].ToString();
             string RLTDREQ = row["RLTDREQ"].ToString();
             string UNITIZMTHD = row["UNITIZMTHD"].ToString();
             string DEPRTECDE = row["DEPRTECDE"].ToString();
             string DEPRECCONV = row["DEPRECCONV"].ToString();
             string SUBACCTGRP = row["SUBACCTGRP"].ToString();
             string SUBACCT = row["SUBACCT"].ToString();
             string WRXCOORD = row["WRXCOORD"].ToString();
             string WRYCOORD = row["WRYCOORD"].ToString();
             string WRZCOORD = row["WRZCOORD"].ToString();
             string WRREQDTE = row["WRREQDTE"].ToString();
             string WRKREQGRP = row["WRKREQGRP"].ToString();
             string CHGTODEPT = row["CHGTODEPT"].ToString();
             string CATG = row["CATG"].ToString();
             string TASK = row["TASK"].ToString();
             string STDTASK = row["STDTASK"].ToString();
             string JODESC = row["JODESC"].ToString();
             string SERVICE = row["SERVICE"].ToString();
             string SVCSEQ = row["SVCSEQ"].ToString();
             string METERNBR = row["METERNBR"].ToString();
             string CREW = row["CREW"].ToString();
             string JOSCHSTRDTE = row["JOSCHSTRDTE"].ToString();
             string JOSCHCMPDTE = row["JOSCHCMPDTE"].ToString();
             string JOACTSTRDTE = row["JOACTSTRDTE"].ToString();
             string JOACTCMPDTE = row["JOACTCMPDTE"].ToString();
             string JOSTATUS = row["JOSTATUS"].ToString();
             string JOSTSCDE = row["JOSTSCDE"].ToString();
             string DISPATCHBY = row["DISPATCHBY"].ToString();
             string DISPATCHTO = row["DISPATCHTO"].ToString();
             string DISPATCHDTE = row["DISPATCHDTE"].ToString();
             string DISPATCHTIM = row["DISPATCHTIM"].ToString();
             string JOUOP = row["JOUOP"].ToString();
             string JOUOPQTY = row["JOUOPQTY"].ToString();
             string JODEPT = row["JODEPT"].ToString();
             string JOPROJNBR = row["JOPROJNBR"].ToString();
             string JOXCOORD = row["JOXCOORD"].ToString();
             string JOYCOORD = row["JOYCOORD"].ToString();
             string JOZCOORD = row["JOZCOORD"].ToString();
             string DFTPRACCT = row["DFTPRACCT"].ToString();
             string DFTPIACCT = row["DFTPIACCT"].ToString();
             string DFTPOACCT = row["DFTPOACCT"].ToString();
             string DFTPCACCT = row["DFTPCACCT"].ToString();
             string NEWMTRNBR = row["NEWMTRNBR"].ToString();
             // 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 PostJobOrderSync
   {
       // Add property for each input param in order to map a field to it
       [Required(ErrorMessage = "Required")]
       [RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
       public string syncType{get; set;}

       public PostJobOrderSync()
       {
           //Set any defaults here
       }
   }
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the PostJobOrderSync 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.PostJobOrderSync

@{
   ViewBag.Title = "PostJobOrderSync";
}

<h2>PostJobOrderSync</h2>
@using (Html.BeginForm()) {
   @Html.AntiForgeryToken()
   @Html.ValidationSummary(true)
   <fieldset>
   <legend>PostJobOrderSync</legend>
       <div class="editor-label">
           @Html.LabelFor(model => model.syncType)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.syncType)
           @Html.ValidationMessageFor(model => model.syncType)
       </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/PostJobOrderSync
public ActionResult PostJobOrderSync()
{
   // Create a new instance of the model to pick up any default values.
   PostJobOrderSync model =  new PostJobOrderSync();

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

// 
// POST: /MyController/PostJobOrderSync
[HttpPost]
public ActionResult PostJobOrderSync(FormCollection collection)
{
   string url = "v3/Naviline/WorkOrders/JobOrderSync";
   // Get the value from each input field
   NameValueCollection inputParms = new NameValueCollection();
   inputParms.Add("syncType", collection["syncType"]);

   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", "PostJobOrderSync");
       return View("Error", info);
   }
}