Method PostItemChangeInformation

Summary

Item Change Information

Remarks

Returns a list of items that have been added or changed within a date range. You request either a date range for additions or a date range for item changes.

Requires

Input Parameters

NameTypeLengthDescription
addFromDate mmddyy 6 Search from Date Added in MMddyy format.
addToDate mmddyy 6 Search to Date Added in MMddyy format.
chgFromDate mmddyy 6 Search from Date Changed in MMddyy format.
chgToDate mmddyy 6 Search to Date Changed in MMddyy format.

Example

POST http://localhost/FusionServices/v3/Naviline/ProductInventory/ItemChangeInformation

Return Values

NameDescription
Building Building code value.
Commodity Commodity code value.
SubComm Sub Commodity code value.
Item Item number value.
Description1 Description1 value.
Description2 Description2 value.
ExpenseAccount ExpenseAccount value.
MinimumQty Minimum Qty value.
MaximumQty Maximum Qty value.
QtyOnHand Quantity On Hand value.
QtyAllocated Quantity Allocated value.
QtyOnOrder Quantity On Order value.
AverageUnitCost Average Unit Cost value.
LastUnitCost Last Unit Cost value.
ErrorCode 0000=Success
ErrorDescription Error message describing any error that occurred

Sample Responses

Sample Code

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

public void MethodName(parms)
{
   string uri = "http://localhost/FusionServices/v3/Naviline/ProductInventory/ItemChangeInformation";
   System.Collections.Specialized.NameValueCollection postParms = 
     new System.Collections.Specialized.NameValueCollection(); 
   // Set paramater values
   postParms.Add("addFromDate",System.Web.HttpUtility.UrlEncode(""));
   postParms.Add("addToDate",System.Web.HttpUtility.UrlEncode(""));
   postParms.Add("chgFromDate",System.Web.HttpUtility.UrlEncode("010118"));
   postParms.Add("chgToDate",System.Web.HttpUtility.UrlEncode("010120"));

   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 Building = row["Building"].ToString();
             string Commodity= = row["Commodity="].ToString();
             string SubComm = row["SubComm"].ToString();
             string Item = row["Item"].ToString();
             string Description1 = row["Description1"].ToString();
             string Description2 = row["Description2"].ToString();
             string ExpenseAccount = row["ExpenseAccount"].ToString();
             string MinimumQty = row["MinimumQty"].ToString();
             string MaximumQty = row["MaximumQty"].ToString();
             string QtyOnHand = row["QtyOnHand"].ToString();
             string QtyAllocated = row["QtyAllocated"].ToString();
             string QtyOnOrder = row["QtyOnOrder"].ToString();
             string AverageUnitCost = row["AverageUnitCost"].ToString();
             string LastUnitCost = row["LastUnitCost"].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 PostItemChangeInformation
   {
       // Add property for each input param in order to map a field to it
       [RegularExpression("^(?=.{0,6}$).*", ErrorMessage = "Must be 6 characters or less. ")]
       public string addFromDate{get; set;}

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

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

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

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

@{
   ViewBag.Title = "PostItemChangeInformation";
}

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

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

// 
// POST: /MyController/PostItemChangeInformation
[HttpPost]
public ActionResult PostItemChangeInformation(FormCollection collection)
{
   string url = "v3/Naviline/ProductInventory/ItemChangeInformation";
   // Get the value from each input field
   NameValueCollection inputParms = new NameValueCollection();
   inputParms.Add("addFromDate", collection["addFromDate"]);
   inputParms.Add("addToDate", collection["addToDate"]);
   inputParms.Add("chgFromDate", collection["chgFromDate"]);
   inputParms.Add("chgToDate", collection["chgToDate"]);

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