Method PostUserDefInfo
Summary
Add User Defined Information
Requires
- NaviLine 9.1.17.3 or higher
Input Parameters
Name | Type | Length | Description |
function |
System.String |
1 |
Function Blank=Write Location ID Key, P=Write Parcel X-Ref Key |
locationID |
numeric |
9 |
[Required] Location ID |
userDefCode |
System.String |
4 |
[Required] User defined code |
userDefText |
System.String |
40 |
User defined text. 40 chars max. |
userDefDate |
mmddyy |
6 |
User defined date. Format=MMddyy. |
subCode |
System.String |
6 |
Sub code for user defined code |
userDefNumber |
numeric |
13 |
User defined number |
Example
POST http://localhost/FusionServices/v3/Naviline/Land/UserDefInfo
Return Values
Name | Description |
ErrorCode |
|
ApplicationCode |
|
LastChangedMonth |
|
LastChangedDay |
|
LastChangedYear |
|
LastChangedUser |
|
Sample Responses
{
"ServerElapsedTime": "00:00:05.0657074",
"Rows": [],
"OutputParms": {
"ErrorCode": "",
"NotUsed": "000000",
"ApplicationCode": "",
"LastChangedMonth": "00",
"LastChangedDay": "00",
"LastChangedYear": "00",
"LastChangedUser": ""
}
}
Sample Code
using System.Net;
string uri = "http://localhost/FusionServices/v3/Naviline/Land/UserDefInfo";
System.Collections.Specialized.NameValueCollection postParms =
new System.Collections.Specialized.NameValueCollection();
postParms.Add("function",System.Web.HttpUtility.UrlEncode("P"));
postParms.Add("locationID",System.Web.HttpUtility.UrlEncode("49324"));
postParms.Add("userDefCode",System.Web.HttpUtility.UrlEncode("PCST"));
postParms.Add("userDefText",System.Web.HttpUtility.UrlEncode("PARCEL TEXT"));
postParms.Add("userDefDate",System.Web.HttpUtility.UrlEncode("050417"));
postParms.Add("subCode",System.Web.HttpUtility.UrlEncode("0"));
postParms.Add("userDefNumber",System.Web.HttpUtility.UrlEncode("1500"));
using (WebClient req = new WebClient())
{
byte[] responseBytes = wc.UploadValues(new Uri(uri), "POST", postParms);
string stringResult = Encoding.UTF8.GetString(responseBytes);
}
C# Razor MVC Sample Code
using System;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Collections.Specialized;
using FusionServiceHelper.Models;
namespace FusionRazor.Models
{
public class PostUserDefInfo
{
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string function{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("[0-9]{0,9}", ErrorMessage = "Numeric values only. Must be 9 digits or less. ")]
public string locationID{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,4}$).*", ErrorMessage = "Must be 4 characters or less. ")]
public string userDefCode{get; set;}
[RegularExpression("^(?=.{0,40}$).*", ErrorMessage = "Must be 40 characters or less. ")]
public string userDefText{get; set;}
[RegularExpression("^(?=.{0,6}$).*", ErrorMessage = "Must be 6 characters or less. ")]
public string userDefDate{get; set;}
[RegularExpression("^(?=.{0,6}$).*", ErrorMessage = "Must be 6 characters or less. ")]
public string subCode{get; set;}
[RegularExpression("[0-9]{0,13}", ErrorMessage = "Numeric values only. Must be 13 digits or less. ")]
public string userDefNumber{get; set;}
public PostUserDefInfo()
{
}
}
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the PostUserDefInfo 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.PostUserDefInfo
@{
ViewBag.Title = "PostUserDefInfo";
}
<h2>PostUserDefInfo</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>PostUserDefInfo</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.locationID)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.locationID)
@Html.ValidationMessageFor(model => model.locationID)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.userDefCode)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.userDefCode)
@Html.ValidationMessageFor(model => model.userDefCode)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.userDefText)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.userDefText)
@Html.ValidationMessageFor(model => model.userDefText)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.userDefDate)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.userDefDate)
@Html.ValidationMessageFor(model => model.userDefDate)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.subCode)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.subCode)
@Html.ValidationMessageFor(model => model.subCode)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.userDefNumber)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.userDefNumber)
@Html.ValidationMessageFor(model => model.userDefNumber)
</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;
public ActionResult PostUserDefInfo()
{
PostUserDefInfo model = new PostUserDefInfo();
return View("~/Views/MyFolderPath/PostUserDefInfo.cshtml", model);
}
[HttpPost]
public ActionResult PostUserDefInfo(FormCollection collection)
{
string url = "v3/Naviline/Land/UserDefInfo";
NameValueCollection inputParms = new NameValueCollection();
inputParms.Add("function", collection["function"]);
inputParms.Add("locationID", collection["locationID"]);
inputParms.Add("userDefCode", collection["userDefCode"]);
inputParms.Add("userDefText", collection["userDefText"]);
inputParms.Add("userDefDate", collection["userDefDate"]);
inputParms.Add("subCode", collection["subCode"]);
inputParms.Add("userDefNumber", collection["userDefNumber"]);
try
{
FusionServiceRequest request = new FusionServiceRequest();
FusionServiceResult result = request.Post(url, inputParms);
return View("Result", result);
}
catch(Exception e)
{
HandleErrorInfo info = new HandleErrorInfo(e, "MyController", "PostUserDefInfo");
return View("Error", info);
}
}