Method PostMiscCodeInquiry

Summary

Returns misc information codes and user-defined codes for locations.

Remarks

Use the Function key to either read a record or search and loop through records.

Use the Order code to select searching for Miscellaneous codes and/or User Defined codes.

Requires

Input Parameters

NameTypeLengthDescription
Function System.String 0 [Required] READRECORD | STARTNEXT | READNEXT
Order System.String 0 [Required] CODEAPPL | ANYCODE | ANYCODEAPPL | ANYCODEUSER
MiscCode System.String 4 [Required] The 4 char code for the misc inforation or user-defined code
MiscCodeAppl System.String 2 The 2 char application code. Required for CODEAPPL and ANYCODEAPPL.

Example

POST http://localhost/FusionServices/v2/NaviLine/Land/MiscCodeInquiry

Sample Responses

Sample Code

using System.Net;

string uri = "http://localhost/FusionServices/v2/NaviLine/Land/MiscCodeInquiry";
System.Collections.Specialized.NameValueCollection postParms = 
     new System.Collections.Specialized.NameValueCollection(); 

postParms.Add("Order",System.Web.HttpUtility.UrlEncode("APPLCODE"));
postParms.Add("Function",System.Web.HttpUtility.UrlEncode("READRECORD"));
postParms.Add("MiscCode",System.Web.HttpUtility.UrlEncode("MISC"));
postParms.Add("MiscCodeAppl",System.Web.HttpUtility.UrlEncode("LM"));
using (WebClient req = new WebClient())
{
    byte[] responseBytes = wc.UploadValues(new Uri(uri), "POST", postParms);
    string stringResult = Encoding.UTF8.GetString(responseBytes); 
    // TODO
}

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 PostMiscCodeInquiry
   {
       // Add property for each input param in order to map a field to it
       [Required(ErrorMessage = "Required")]
       public string Function{get; set;}

       [Required(ErrorMessage = "Required")]
       public string Order{get; set;}

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

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

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

@{
   ViewBag.Title = "PostMiscCodeInquiry";
}

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

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

// 
// POST: /MyController/PostMiscCodeInquiry
[HttpPost]
public ActionResult PostMiscCodeInquiry(FormCollection collection)
{
   string url = "v2/NaviLine/Land/MiscCodeInquiry";
   // Get the value from each input field
   NameValueCollection inputParms = new NameValueCollection();
   inputParms.Add("Function", collection["Function"]);
   inputParms.Add("Order", collection["Order"]);
   inputParms.Add("MiscCode", collection["MiscCode"]);
   inputParms.Add("MiscCodeAppl", collection["MiscCodeAppl"]);

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