Cargo Tracking - I/O Parameters and Code Sample

This appendix provides reference information for all HTML variables for developing a customized Tracking solution for your company web site. All variables are uploaded using POST method



Input Parameters


Name
Type
M/C/O
Description
_strUriReturn
String
Optional
Postback URL web address to recieve Posted Form Data items. If it is empty or invalid then the data result is in XML data format (see Input Variables)
Warning: This variable is deprecated and its use will be discontinued in later versions. Prepare to retreive result only in XML data format.
_strModule
Char
Mandatoty
W - Warehouse or Q - QuickCourier
_strNumber
String
Conditional
Tracking Number. For regular Customr Accounts (ex. shipperID, consigneeID, thirdpartyID, ...) cannot be a partial value, it has to be the exact Tracking Number
_strReference
String
Conditional
Reference String
_strLanguage
String
Optional
Language Value String will post back without processing
_strCustomValue
String
Optional
Custom Value String will post back without processing
_strAccountNumber
String
Mandatory
Customer Account Number (ex. shipperID, consigneeID, thirdpartyID, ...)
Note: For non-local hosted pages this account needs a contact named WEB_AUTOMATON
_strAccountPassword
String
Mandatory
Account Password

Output Parameters


Name
Type
Description
_strLanguage
String
_strLanguage value
_strCustomValue
String
_CustomValue value
Error_Number
Number
Error Number if exception occurred
Error_Msg
String
Message Error if exception occurred
Module_Code
Char
Returns _strModule value
Number_Value
String
Returns _strNumber value
Reference_Value
String
Returns _strReference value
Result_Count
Number
Result record count. If more than 15 hits then posting only the first most recent 15

Case _strModule = W


Tracking_Flag
Boolean
Record made an exact match with _strNumber
Tracing_Number_XXX
String
Tracking Number (partial) matching _strNumber or _strReference
Warehouse_Number_XXX
String
Warehouse Receipt Number
Shipper_Name_XXX
String
Shipper Name
Consignee_Name_XXX
String
Consignee Name
Destination_Code_XXX
String
Destination Code
Status_Code_XXX
String
Status Code updates from FieldB in Warehouse Receipt
Vehicle_Flag
Boolean
Tracking holds vehicle information
Vehicle_Vin_Number
String
Vehicle VIN Number if Vehicle Flag is True
Origin_Received_Date_XXX
Date
Cargo received at warehouse date
Origin_Loaded_Date
Date
Scanned to loading guide date
Destination_Unloaded_Date
Date
Received cargo at destination agent place
Destination_Delivered_Date
Date
Delivered to final consignee date
Destination_Delivered_User
String
Delivered to final consignee made by user
Destination_Delivered_Initials
String
Delivered to final consignee signed initials
Additional_Cargo_Count
Number
Warehouse receipt has more lines (only when Tracking_Flag = True)
Additional_Tracking_Number_XXX
String
Tracking Number in additional lines
Additional_Vehicle_Flag_XXX
Boolean
Vehicle additional line
Additional_Vehicle_Vin_Number_XXX
String
Vehicle VIN Number in additional line
Other_XXX
String
Tracking Number in warehouse receipt matching _strReference
Event_Count
Nummber
Status events (only when Tracking_Flag = True)
Event_Time_XXX
String
Time of the status event
Event_Description_XXX
String
Status event description

Case _strModule = Q


Tracking_Flag
Boolean
Record made an exact match with _strNumber
Result_Recieving_Count
Number
Receiving Batch records count. If more than 15 hits then posting only the first most recent 15
Recieving_Tracking_Number_XXX
String
Matched Tracking Number
Recieving_Batch_Number_XXX
String
Receiving Batch Number
Recieving_Manifest_Number_XXX
String
Manifest Number in Batch
Recieving_Comment_XXX
String
Comment
Tracking_Number_XXX
String
Tracking Number with partial matched
Tracking_Entered_XXX
Date
Date entered
Manifest_Number_XXX
String
Manifest number
Courier_Waybill_Number
String
Courier Waybill Number
Master_AWB_Number
String
Master Air Waybill Number
Shipper_Name
String
Shipper Name
Consignee_Name
String
Consignee Name
Pieces
Number
Total Pieces
Weight_LB
Number
Total Weight Pounds
Weight_KG
Number
Total Weight Kilograms
Dimmensions_IN
String
Length X Width X Height in inches
Dimmensions_CM
String
Length X Width X Height in centimeters
Description
String
Description
Comment
String
Comment
Status_Lines_Count
Number
Status Action Lines Count
Status_Code_Line_XXX
String
Status Action Code
Status_Action_Line_XXX
String
Status Action
Status_Date_Line_XXX
String
Status Action Date
Status_Comment_Line_XXX
String
Status Action Comment
Trackings_Same_Consignee_Count
Number
More trackings for this consignee in this manifest
Trackings_Same_Consignee_CSV_List
Stirng
List of Tracking Numbers comma separated

ASPX Form Code


TrackingTest.aspx Code

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="TrackingTest.aspx.vb" Inherits="KSSS_TrackingTest" %>

        <html xmlns="http://www.w3.org/1999/xhtml">

        <head id="Head1" runat="server">
            
            <title></title>
            
            <script language="javascript" type="text/javascript">
            // <![CDATA[

                function Quick_onclick() {
                    form1._strModule.value = "Q";
                    return true
                }

                function Warehouse_onclick() {
                    form1._strModule.value = "W";
                    return true
                }

                function OnFormSubmit() {
                    if (form1._strServerUri.value == "") {
                        form1._strServerUri.focus();
                        return false;
                    } else {
                        form1.action = form1._strServerUri.value;
                        return true
                    }
                }

            // ]]>
            </script>

        </head>

        <body>

            <form id="form1" method="post" onsubmit="return OnFormSubmit();"  
                action="">

                <div>

                    <h3>Tracking Test Page</h3>

                    <table style="width: 465px" cellpadding="4">
                        <tr>
                            <td>
                                <nobr>Uri to Test</nobr>
                            </td>
                            <td style="width: 100%">
                                <input id="_strServerUri" name="_strServerUri" type="text" value="http://YOUR_FREIGHT_HANDLER_SERVER_NAME/TrackingHandler.ashx" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Tracking
                            </td>
                            <td style="width: 100%">
                                <input id="_strNumber" name="_strNumber" type="text" value="<%=HttpContext.Current.Request.Form.Item("_strNumber") %>" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <nobr>Your Account</nobr>
                            </td>
                            <td style="width: 100%">
                                <input id="_strAccountNumber" name="_strAccountNumber" type="text" value="<%=HttpContext.Current.Request.Form.Item("_strAccountNumber") %>" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <nobr>Your Password</nobr>
                            </td>
                            <td style="width: 100%">
                                <input id="_strAccountPassword" name="_strAccountPassword" type="password" value="" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Reference
                            </td>
                            <td style="width: 100%">
                                <input id="_strReference" name="_strReference" type="text" value="<%=HttpContext.Current.Request.Form.Item("_strReference") %>" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <nobr>Uri Return</nobr>
                                (The use of this variable is deprecated and its use will be discontinued in later versions)
                            </td>
                            <td style="width: 100%">
                                <input id="_strUriReturn" name="_strUriReturn" type="test" value="<%=HttpContext.Current.Request.Url.AbsoluteUri %>" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan=2>
                                <br />
                                <input id="Quick" type="submit" value="Quick Courier" 
                                    onclick="return Quick_onclick()" />
                                <input id="Warehouse" type="submit" value="Warehouse" 
                                    onclick="return Warehouse_onclick()" />
                            </td>
                        </tr>

                    </table>

                    <input id="_strModule" name="_strModule" type="hidden" />
                        
                </div>

            </form>

            <br />

            <asp:Label ID="lblResult" runat="server" Text=""></asp:Label>

        </body>

    </html>

TrackingTest.aspx.vb Code

    Partial Class KSSS_TrackingTest
    Inherits System.Web.UI.Page

        Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
            For Each vInter As String In Request.Form.Keys
                If vInter.StartsWith("_") = False Then
                    lblResult.Text &= vInter & ": " & Request.Form.Item(vInter) & "<br />"
                End If
            Next
        End Sub

    End Class


Javascript Code


TrackingTest.html

    <!DOCTYPE html>

    <html>

        <head>
            <meta charset="UTF-8">
            <title>XML FETCH() EXAMPLE</title>
        
            <style type="text/css">
        
                .no-wrap 
                {
                    white-space: nowrap;
                }
            
                table td 
                {
                    padding: 4px;
                }
        
            </style>

            <script type="text/javascript">
            
                function Quick_onclick() {
                    form1._strModule.value = "Q";
                    return true
                }

                function Warehouse_onclick() {
                    form1._strModule.value = "W";
                    return true
                }

                function OnFormSubmit() {
                    return false
                }

                function xmlpostdatafetch(value) {
                
                    try {
                
                        form1._strModule.value = value;

                        let formData = new FormData(form1);
                                 
                        fetch(form1._strServerUri.value, {
                            method: 'POST',
                            mode: 'cors',
                    
                            referrerPolicy: 'no-referrer',
                            body: new URLSearchParams(formData)
                        })
                        .then(response => {
                            return response.text();
                        })
                        .then(data => { 
                            document.getElementById('xmlresponse').innerHTML = data.replace(/</gi,'<').replace(/>/gi,'>\n');
                        })
                        .catch((err) => {
                            document.getElementById('xmlresponse').innerHTML = 'Error fetching XML data from: ' + form1._strServerUri.value;
                        });
                
                        document.getElementById('xmlresponse').innerHTML = 'Waiting for XML data...';
                
                    } catch(err) {
                        document.getElementById('xmlresponse').innerHTML = 'Error fetching XML data' + err;
                    }
                }
                        
            </script>
        </head>
    
        <body>
        
            <form id="form1" name="form1" method="post"  
                action="">

                <div>

                    <h3>Tracking Test Page</h3>

                    <table>
                        <tr>
                            <td class="no-wrap">
                                Uri to Test
                            </td>
                            <td style="width: 100%">
                                <input id="_strServerUri" name="_strServerUri" type="text" value="http://YOUR_FREIGHT_HANDLER_SERVER_NAME/TrackingHandler.ashx" />
                            </td>
                        </tr>
                        <tr>
                            <td class="no-wrap">
                                Tracking
                            </td>
                            <td style="width: 100%">
                                <input id="_strNumber" name="_strNumber" type="text" value="" />
                            </td>
                        </tr>
                        <tr>
                            <td class="no-wrap">
                                Your Account
                            </td>
                            <td style="width: 100%">
                                <input id="_strAccountNumber" name="_strAccountNumber" type="text" value="" />
                            </td>
                        </tr>
                        <tr>
                            <td class="no-wrap">
                                Your Password
                            </td>
                            <td style="width: 100%">
                                <input id="_strAccountPassword" name="_strAccountPassword" type="text" value="" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Reference
                            </td>
                            <td style="width: 100%">
                                <input id="_strReference" name="_strReference" type="text" value="" />
                            </td>
                        </tr>
                        <tr>
                            <td class="no-wrap">
                                Uri Return (deprecated)
                            </td>
                            <td style="width: 100%">
                                <input id="_strUriReturn" name="_strUriReturn" type="text" value="" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan=2>
                          
                            </td>
                        </tr>

                    </table>

                    <input id="_strModule" name="_strModule" type="hidden" />
                        
                </div>

            </form>

            <br />
            <input id="Quick" type="button" value="Quick Courier" 
                onclick="xmlpostdatafetch('Q');" />
            <input id="Warehouse" type="button" value="Warehouse" 
                onclick="xmlpostdatafetch('W');" />


            <br />
            <br />
            <pre id="xmlresponse">Ready to fetch data</pre>
        
        </body>

    </html>


Tracking Sample Input Values



    _strNumber = "NCC2012"
    _strReference = ""
    _StrModule = "Q"


Tracking Sample Output Values

ASPX Form Output Sample

    Module_Code: Q
    Result_Receiving_Count: 0
    Result_Count: 4
    Tracking_Number_0: NCC20121012093041
    Tracking_Entered_0: 10/12/2012 9:30:41 AM
    Manifest_Number_0: SJOATD091605
    Tracking_Number_1: NCC20121012121756
    Tracking_Entered_1: 10/12/2012 12:17:56 PM
    Manifest_Number_1: SJOATD091605
    Tracking_Number_2: NCC20121019194224
    Tracking_Entered_2: 10/19/2012 7:42:24 PM
    Manifest_Number_2: SJOATD091605
    Tracking_Number_3: NCC20121020103642
    Tracking_Entered_3: 10/20/2012 10:36:42 AM
    Manifest_Number_3: SJOATD091605


Javascript Code Output Sample

    <?xml version="1.0" standalone="yes"?>
    <NewDataSet>
    <DataTable>
    <Module_Code>Q</Module_Code>
    <Result_Receiving_Count>0</Result_Receiving_Count>
    <Result_Count>4</Result_Count>
    <Tracking_Number_0>NCC20121012093041</Tracking_Number_0>
    <Tracking_Entered_0>10/12/2012 9:30:41 AM</Tracking_Entered_0>
    <Manifest_Number_0>SJOATD091605</Manifest_Number_0>
    <Tracking_Number_1>NCC20121012121756</Tracking_Number_1>
    <Tracking_Entered_1>10/12/2012 12:17:56 PM</Tracking_Entered_1>
    <Manifest_Number_1>SJOATD091605</Manifest_Number_1>
    <Tracking_Number_2>NCC20121019194224</Tracking_Number_2>
    <Tracking_Entered_2>10/19/2012 7:42:24 PM</Tracking_Entered_2>
    <Manifest_Number_2>SJOATD091605</Manifest_Number_2>
    <Tracking_Number_3>NCC20121020103642</Tracking_Number_3>
    <Tracking_Entered_3>10/20/2012 10:36:42 AM</Tracking_Entered_3>
    <Manifest_Number_3>SJOATD091605</Manifest_Number_3>
    </DataTable>
    </NewDataSet>



Give us a call we are here to help. Free and Non-Compromise Quote
Disclaimer: This Website uses 'cookies' to store user preferences information. Using this site means you are 'OK with this.

 Powered by K SSS, Inc.
 Powered by K SSS, Inc.
Disclaimer: This Website uses 'cookies' to store user preferences information. Using this site means you are 'OK with this.