Table of Contents

Check TMS status before processing - Code: CHECK TMS STATUS DI

General

This page contains the JSON of the function-set: Check TMS status before processing a DI message.

This function combines Data Integration (DI) and Transportation (TMS): it runs on an inbound Data Integration message, but decides based on the status of the related TMS order, section, or trip. Use it to block processing of the message when the TMS document it belongs to already has a status beyond the point you consider it final. Set it up on the Before Processing Func. Set field of the DI Message Type Card, for message types on table 3PL DI Message.

The function looks for the matching TMS document in this order:

  • The message's own Record ID, if it already points to a TMS document.
  • Otherwise, the document referenced in the message body (JSON or XML), matched by SystemId, then by No. (and Sequence No.), then by WMS Document No., or by External Document No. filtered on the customer.

If the message has a Sequence No., the search is limited to a document type Section; otherwise to an Order or a Trip. Once a document is found, the message's Record ID is set to point to it, so later processing doesn't need to search again.

If the matched document's status is higher than the MAXSTATUS parameter, the message fails. Processing stops with your own ERRORMESSAGE, or, if you leave that parameter empty, with a default message that names the document, its sequence number, its current status, and the maximum allowed status.

Note

By default, a message is still processed when no matching TMS document is found. Set ERRORIFNOTFOUND to TRUE to fail the message instead.

Json code snippet: CHECK TMS STATUS DI

{
  "FunctionSet": {
    "TableNo": 11172786,
    "Entries": [
      {
        "EntryNo": "10000",
        "CodeunitID": "72270119",
        "FunctionCode": "CHECK TMS STATUS DI",
        "Description": "Block processing when the TMS document status exceeds the maximum",
        "Parameters": [
          {
            "ParameterName": "MAXSTATUS",
            "Value": "60-TOCHECK"
          },
          {
            "ParameterName": "ERRORIFNOTFOUND",
            "Value": "FALSE"
          }
        ]
      }
    ]
  }
}

Parameters

The following parameters are applicable on this function.

Name Value Description
MAXSTATUS A code from Status Templates. Mandatory. The highest TMS document status still allowed for this message to be processed.
ERRORIFNOTFOUND Options: TRUE, FALSE. Default: FALSE. Optional. Set to TRUE to fail the message when no matching TMS document is found.
ERRORMESSAGE Free text. Optional. Your own error text, shown instead of the default message when the status is exceeded.