Method PostEmployeeInfoSync

Summary

Employee Info Sync - Coming soon ... targeted release 21.3

Input Parameters

NameTypeLengthDescription
lastRec System.String 1 [Required] LastRec is used if there are more than 9999 records. Field is numeric. Populate with nine zeros on initial call. If there is a value on return, use that value to retrieve additional records.

Example

POST http://localhost/FusionServices/v3/Naviline/Payroll/EmployeeInfoSync

Return Values

NameDescription
LASTREC 999999999
ErrorCode 000
ErrorMessage Success, result set created
LastName Last Name
FirstName First Name
MiddleInitial Middle Initial
EmployeeStatusCode Employee Status Code
CurHrlyRate Current Hourly Rate
AddlHrlyRate Additional Hourly Rate
OTRate Overtime Rate
PremOTRate Premium Overtime Rate
Shift2HrlyRate Shift 2 Hourly Rate
Shift3HrlyRate Shift 3 Hourly Rate
Shift4HrlyRate Shift 4 Hourly Rate
StreetAddr Street Address
StreetAddrLine2 Street Address Line 2
City City
State State
ZipCode Zip Code
EmailAddr Email Address
DeptNumber Department Number
AuthDeptNumber Authorized Department Number
DivisionNumber Division Number
AuthDivNumber Authorized Division Number
EmployeeUniqueNumber Employee Unique Number
ActualPosition Actual Position

Sample Responses

Sample Code

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

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

   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 LastName = row["LastName"].ToString();
             string FirstName = row["FirstName"].ToString();
             string MiddleInitial = row["MiddleInitial"].ToString();
             string EmployeeStatusCode = row["EmployeeStatusCode"].ToString();
             string CurHrlyRate = row["CurHrlyRate"].ToString();
             string AddlHrlyRate = row["AddlHrlyRate"].ToString();
             string OTRate = row["OTRate"].ToString();
             string PremOTRate = row["PremOTRate"].ToString();
             string Shift2HrlyRate = row["Shift2HrlyRate"].ToString();
             string Shift3HrlyRate = row["Shift3HrlyRate"].ToString();
             string Shift4HrlyRate = row["Shift4HrlyRate"].ToString();
             string StreetAddr = row["StreetAddr"].ToString();
             string StreetAddrLine2 = row["StreetAddrLine2"].ToString();
             string City = row["City"].ToString();
             string State = row["State"].ToString();
             string ZipCode = row["ZipCode"].ToString();
             string EmailAddr = row["EmailAddr"].ToString();
             string DeptNumber = row["DeptNumber"].ToString();
             string AuthDeptNumber = row["AuthDeptNumber"].ToString();
             string DivisionNumber = row["DivisionNumber"].ToString();
             string AuthDivNumber = row["AuthDivNumber"].ToString();
             string EmployeeUniqueNumber = row["EmployeeUniqueNumber"].ToString(); 
             string ActualPosition = row["ActualPosition"].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 PostEmployeeInfoSync
   {
       // 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 lastRec{get; set;}

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

@{
   ViewBag.Title = "PostEmployeeInfoSync";
}

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

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

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

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