Method PostRetrieveItemInformation

Summary

Retrieve Item Information - Coming soon... targeted release 21.2

Remarks

Allows you to retrieve detail information for a specific item.

Input Parameters

NameTypeLengthDescription
itemNumber System.String 5 [Required] Item number to search for (leave blank for all).
bldgCode System.String 2 [Required] Building code to search for (leave blank for all).
commodityCode System.String 3 [Required] Commodity code to search for (leave blank for all).
subCommodityCode System.String 3 [Required] Sub Commodity Code to search for (leave blank for all).

Example

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

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.
Location1 Location1 value.
Location2 Location2 value.
Location3 Location3 value.
Location4 Location4 value.
Location5 Location5 value.
MinimumQty Minimum Qty value.
MaximumQty Maximum Qty value.
QtyOnHand Quantity On Hand value.
QtyAllocated Quantity Allocated value.
QtyOnOrder Quantity On Order value.
LastOrderDateMonth Last Order Date Month value.
LastOrderDateDay Last Order Date Day value.
LastOrderDateYear Last Order Date Year value.
LastOrderQty Last Order Quantity value.
LastOrderVendor Last Order Vendor value.
LastRcvDateMonth Last Recieved Date Month value.
LastRcvDateDay Last Recieved Date Day value.
LastRcvDateYear Last Recieved Date Year value.
LastRcvdQty Last Recieved Quantity value.
LastRcvdVendor Last Recieved Vendor value.
AverageUnitCost Average Unit Cost value.
LastUnitCost Last Unit Cost value.
BackOrderQty Back Order Quantity value.
AllocQtyPending Allocated Quantity Pending value.
AllocBackOrderQty Allocated Back Order Quantity value.
AddedToInvDateMonth Added To Inventory Date Month value.
AddedToInvDateDay Added To Inventory Date Day value.
AddedToInvDateYear Added To Inventory Date Year value.
BuildingFrozen Building Frozen value.
QtyOnHandNoUnitCost Quantity On Hand No Unit Cost value.
QtyIssuedNoUnitCost Quantity Issued No Unit Cost value.
AltBinLocation Alt Bin Location value.
BuildingActive Building Active value.
HazmatCode Hazmat Code value.
LastInvDateMonth Last Inventory Date Month value.
LastInvDateDay Last Inventory Date Day value.
LastInvDateYear Last Inventory Date Year value.
AssetSerialReq Asset Serial Requisition value.
OrderUnitofMeasure Unit of Measure for Ordering
IssueUnitofMeasure Unit of Measure for Issueing
LotSize Lot Size
ActiveCode Active/Inactive Code
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/RetrieveItemInformation";
   System.Collections.Specialized.NameValueCollection postParms = 
     new System.Collections.Specialized.NameValueCollection(); 
   // Set paramater values
   postParms.Add("itemNumber",System.Web.HttpUtility.UrlEncode("00003"));
   postParms.Add("bldgCode",System.Web.HttpUtility.UrlEncode("RH"));
   postParms.Add("commodityCode",System.Web.HttpUtility.UrlEncode("JRH"));
   postParms.Add("subCommodityCode",System.Web.HttpUtility.UrlEncode("JRH"));

   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 Location1 = row["Location1"].ToString();
             string Location2 = row["Location2"].ToString();
             string Location3 = row["Location3"].ToString();
             string Location4 = row["Location4"].ToString();
             string Location5 = row["Location5"].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 LastOrderDateMonth = row["LastOrderDateMonth"].ToString();
             string LastOrderDateDay = row["LastOrderDateDay"].ToString();
             string LastOrderDateYear = row["LastOrderDateYear"].ToString();
             string LastOrderQty = row["LastOrderQty"].ToString();
             string LastOrderVendor = row["LastOrderVendor"].ToString();
             string LastRcvDateMonth = row["LastRcvDateMonth"].ToString();
             string PILRDD = row["PILRDD"].ToString();
             string PILRDY = row["PILRDY"].ToString();
             string LastRcvdQty = row["LastRcvdQty"].ToString();
             string LastRcvdVendor = row["LastRcvdVendor"].ToString();
             string AverageUnitCost = row["AverageUnitCost"].ToString();
             string LastUnitCost = row["LastUnitCost"].ToString();
             string BackOrderQty = row["BackOrderQty"].ToString();
             string AllocQtyPending = row["AllocQtyPending"].ToString();
             string AllocBackOrderQty = row["AllocBackOrderQty"].ToString();
             string AddedToInvDateMonth = row["AddedToInvDateMonth"].ToString();
             string AddedToInvDateDay = row["AddedToInvDateDay"].ToString();
             string AddedToInvDateYear = row["AddedToInvDateYear"].ToString();
             string BuildingFrozen = row["BuildingFrozen"].ToString();
             string QtyOnHandNoUnitCost = row["QtyOnHandNoUnitCost"].ToString();
             string QtyIssuedNoUnitCost = row["QtyIssuedNoUnitCost"].ToString();
             string AltBinLocation = row["AltBinLocation"].ToString();
             string BuildingActive = row["BuildingActive"].ToString();
             string HazmatCode = row["HazmatCode"].ToString();
             string LastInvDateMonth = row["LastInvDateMonth"].ToString();
             string LastInvDateDay = row["LastInvDateDay"].ToString();
             string LastInvDateYear = row["LastInvDateYear"].ToString();
             string AssetSerialReq = row["AssetSerialReq"].ToString();
             string OrderUnitofMeasure = row["OrderUnitofMeasure"].ToString();
             string IssueUnitofMeasure = row["IssueUnitofMeasure"].ToString();
             string LotSize = row["LotSize"].ToString();
             string ActiveCode = row["ActiveCode"].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 PostRetrieveItemInformation
   {
       // Add property for each input param in order to map a field to it
       [Required(ErrorMessage = "Required")]
       [RegularExpression("^(?=.{0,5}$).*", ErrorMessage = "Must be 5 characters or less. ")]
       public string itemNumber{get; set;}

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

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

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

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

@{
   ViewBag.Title = "PostRetrieveItemInformation";
}

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

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

// 
// POST: /MyController/PostRetrieveItemInformation
[HttpPost]
public ActionResult PostRetrieveItemInformation(FormCollection collection)
{
   string url = "v3/Naviline/ProductInventory/RetrieveItemInformation";
   // Get the value from each input field
   NameValueCollection inputParms = new NameValueCollection();
   inputParms.Add("itemNumber", collection["itemNumber"]);
   inputParms.Add("bldgCode", collection["bldgCode"]);
   inputParms.Add("commodityCode", collection["commodityCode"]);
   inputParms.Add("subCommodityCode", collection["subCommodityCode"]);

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