Function Set Entries
General
A function set is a list of functions that run one after the other. By setting up function set entries you combine a range of flexible functions and use them in status templates, steps, and some specific fields, such as the Invoice Info Description Code on the customer.
Use a function set when a standard field or setting can't express the logic you need. In TMS you typically use function sets to:
- Calculate the quantity for a contract price, for example the kilometers of a trip or the payweight of an order (Agreement Quantity Calculation / Criteria).
- Add conditions to an order, for example ADR or tail lift.
- Determine the department, plan department, or plan box of a section from the routing strategy.
- Send tasks to a device, or create communication log entries and e-mails.
- Build the text that appears on an invoice line.
Each entry in the set runs a function of a codeunit. Entries with the option End Execution set can stop the rest of the set, so the order of the entries matters.
Example of function set entries:

| Field | Description |
|---|---|
| Codeunit ID | The codeunit that contains the function to run. Select it from the list. |
| Function Code | The function to run in the codeunit. Select it from the list. |
| Description | The description of the function. |
| Parameter Values | The statement based on the parameters that you enter on the Parameters tab. |
| Table No. | The table that the function works on. |
| Table Filter | The filter that limits the records the function is applied to. |
| Blocked | When enabled, the entry is no longer run. |
| End Execution | Determines when the set stops running: Always stops directly after this entry. If Result Found stops when the function returns a result. |
| On Different Table No. | Determines what happens when the record isn't of the table of the function: Execute Always, Execute for Derived Tables Only, Skip Line, or Error. |
| Format Result As | How the result is formatted: Amount, Unit Price, or Xml. |
Note
- Copy function set entries by using the action Copy Last Function Set.
- To copy function set entries from a test environment to a production environment, use the action Copy Json to Clipboard in the test environment. In the production environment, choose Edit Json and paste the set.
List of functions sets
The following table contains a number of functions. By clicking on the link a page with the Json-code can be opened so you can copy it to 3PL Dynamics.
| Applicable Area | Value | Result function Set |
|---|---|---|
| Agreement Quantity Calculation / Criteria | CONDITION ADR | The function checks if the goods lines on the Order contains Hazardous in the field: No.. If so the Condition: ADR will be applied |
| Agreement Quantity Calculation / Criteria | CONDITION TAIL LIFT | The function checks if the from-or to-addresson the Order contains a Condition. If so the Condition: TAIL LIFT will be applied |
| Agreement Quantity Calculation / Criteria | CONDITION Unloading Strict | The function checks if the time-window between unloading time from and unloading time to on the Order is less then 15minutes. If so the Condition: UL STRICKT will be applied |
| Agreement Quantity Calculation / Criteria | CONDITION Unloading 09:00h | Will check if the unloading time to on the Order is before 09:00 hours. If so the Condition: UL UPTO 09 will be applied |
| Agreement Quantity Calculation / Criteria | EXTRA_STOP | Filters orders within the linked order, not being the order with the highest value in field:Kilometer. This function will apply each suborder as as stop. |
| Agreement Quantity Calculation / Criteria | FIXED | Function will always return 1 so can be used if only 1 price is set in a contract detail line. |
| Agreement Quantity Calculation / Criteria | FUEL_SURCHARGE | Calculates the amount of fuel surcharge based on the Fuel Clause. |
| Agreement Quantity Calculation / Criteria | KM_MAX | Filters the order with the highest value in field:Kilometer within the linked orders. |
| Agreement Quantity Calculation / Criteria | KM_TRIP | Returns the number of kilometers on a trip. The parameter used will select either the planned, actual or agreed number of Kilometers |
| Agreement Quantity Calculation / Criteria | PAYWEIGHT | Returns the total payweight on goods on both single orders as well as linked orders. |
| Agreement Quantity Calculation / Criteria | SECTION_FIRST | Determines if a section is the first section of an order. |
| Agreement Quantity Calculation / Criteria | SECTION_NOT_FIRST | Determines if a section is not the first section of an order. |
| Agreement Quantity Calculation / Criteria | UNLOADAM | Will check if a condition is set on the order so a surcharge can be applied. |
| Agreement Quantity Calculation / Criteria | UOM_QTY | Adds quantity of the the specified UOM on the order. |
| Agreement Quantity Calculation / Criteria | TOLL REVENUE | Will calculate Toll Revenue based on the Toll Entry Lines on an Order and multiply it with a factor(value B) |
| Agreement Quantity Calculation / Criteria | WEEKEND | Will check if an order. is (un)loaded on the days set in the parameters of the function. |
| Communication Log | CREATE COM. LOG | Creates a Communication Log Entry based on a Event Trigger Event. |
| Communication Log | ETA_LOAD | Creates an e-mail with a ETA load message to be send, based on a Commmunication Log Entry. |
| Communication Log | ETA_UNLOAD | Creates an e-mail with a ETA unload message to be send, based on a Commmunication Log Entry. |
| Communication Log | POD | Creates an e-mail with a POD message to be send, based on a Commmunication Log Entry. |
| Data Integration | CHECK TMS STATUS DI | Blocks processing of a DI message when the matched TMS document's status exceeds a configured maximum. |
| Devices | NEW_TASK_ACT | Creates a task to send the planned activities of a trip to a device. |
| Devices | DEL_TASK_ACT | Creates a task which removes planned activities of a trip which were previously sent to a device |
| Devices | GET INTERNAL VALUE | Determines which Internal Value is applicable based on a external value received in a Device Activity |
| Devices | COPYSTR | Converts the first 10 charactres of a field to a new value |
| Invoice Info Description Code | DOCNO. | A string with the documentnumber on which the revenue is based |
| Invoice Info Description Code | EXT_DOC_QT | A string with the the external document number and quantity on which the cost is based |
| Invoice Info Description Code | UOM_QTY_AR | A string with the Unit Of Measure Code, The Quantity and the Area based on the agreement on which the revenue is based |
| Orders | SET DFLT PARTY VALUE | Fills the Fact Box: Parties on a TMS Order based on the TMS Party Template. |
| Orders | UPD PARTY CONTACTS | Reloads the Contact lines in the Fact Box: Parties on a TMS Order based on the TMS Party Template. |
| Sections | GET_DEPARTMENT | Determines the Department on a section based on the Routingstrategy |
| Sections | GET_PLAN_DEPARTMENT | Determines the Plan Department on a section based on the Routingstrategy |
| Sections | GET_PLANBOX | Determines the Plan Box on a section based on the Routingstrategy |
| Sections | GET MILKRUN PLANBOX | The function will verify whether a valid Milkrun Strategy and its associated Milkrun Template can be applied when executing the Routing Strategy. |
| Sections | CALCULATE NETWORK | Automatically splits an order across a milk run/route network by applying the Section Configuration linked to the applicable milk run/route, with an optional default via address and first/last mile address override. |
| Sections | NORM_TIME | Calculates the norm times on sections based on the Norm time Strategy |
| Status template | STATUSCHANGE_ON_REVENUE | The status of the order will be changed depending on wether there are revenue lines. |
| Transport Conditions Code | MAX_LENGTH_WIDTH_HEIGHT | Adds a condition to the order or section with the maximum length, width and height. |
| Trip (TMS) | EMISSION_CALCULATE | Will calculate the emission on a Trip and device the emission-entries over the Sections planned on the Trip. |
| Trip (TMS) | EMISSION_METHOD | Defines on what method the emissions are based on at Trip. |
| Trip (TMS) | FILTER_ON_TRIPS_BASED_ON_SHIPMENTS | Applies a filter so only Trips based on Shipments will be processed. |
| Trip (TMS) | SEND_WHAT_SAPP_MESSAGE | Creates device task log which sends a What's App Message to the driver of the trip with a tripreport. |
| Trip (TMS) | SET_TRIP_ACT_DATE_TIME | Copies the actual starting date/time and ending date/time from the boardcomputerlog to the Trip-header. |
| Visual Planning | LAYER_FILTER | filters the unplanned section on Loadmeter<=3 |
| Visual Planning | MARKER_CONFIGURATION_LOAD | Configuration on Markertype: load address |
| Visual Planning | MARKER_CONFIGURATION_UNLOAD | Configuration on Markertype: unload address |
| Visual Planning | TimelineSidebarDetails | Configuration on the Timeline Sidebar Details, seeVisual Planning Timeline Setup. |
| Visual Planning | TimelineStopLabel | Configuration on the Timeline Stop Label, see Visual Planning Timeline Setup. |
| Visual Planning | TimelineStopTitle | Configuration on the Timeline Stop Title, see Visual Planning Timeline Setup. |