Function: Create / Update Trip For Sections
General
Object Id: 11172845 Function Id: 350
Purpose of function
The function adds a section to a matching trip. If no matching trip exists, the function creates a new trip and adds the section to it.
Application Area
The function can be used in the status-template of the section.
Functionality
If the status of the section falls outside SECTION.STATUSFILTER, the function exits without making any changes.
The function then looks for a matching trip among the trips whose status is within TRIP.STATUSFILTER, using the following criteria:
- Plan box: when GROUPBY.PLANBOX is set, only trips with the same Plan Box No. as the section are considered.
- Loading date: when GROUPBY.LOAD.DT.FROM is set and the trip already has sections planned, the trip must already contain a section with the same Loading Date From as this section.
- Unloading date: when GROUPBY.UNLD.DT.FROM is set, the same rule applies to the Unloading Date From.
- Linked orders: when GROUPBY.LINK.ORDERS is set, the trip must contain a section with the same Parent Document No. This is checked even for a trip that has no sections yet, so an empty trip never matches on this criterion.
- Unit of measure: when BREAKBY.UOM is set to one of the "Unit of Measure 1..6" configured on the TMS Setup, a trip is skipped if the trip's current total for that unit of measure plus the totals of this section's Good lines for the matching "Quantity UOM n" field would exceed BREAKBY.UOM.QUANTITY.
The section is added to the first trip that satisfies all the active criteria above.
Adding the section to a matching trip
When a matching trip is found, the function:
- Runs
TMS UnLoad Sequence Calculator.CalcLoadUnloadSequenceAddSectionsToExistingTrip. - Runs
TMS Planning Functions.AddSectionToTrip. - Runs
UpdateTripOrdersSections.
Creating a new trip
When no trip matches, the function creates a new trip based on the section's Loading Date From and sets the Plan Box No. on the new trip from the section.
Running a step afterward
When STEPCODE.AFTER is set to an existing step code, that step runs on the trip (new or matched) after the section has been added.
Parameters
| Name | Description |
|---|---|
| SECTION.STATUSFILTER | Mandatory. The section's status must be within this filter, otherwise the function exits without any changes. |
| TRIP.STATUSFILTER | Mandatory. Only trips with a status within this filter are considered as a match. |
| GROUPBY.PLANBOX | Default: true. When set, only a trip with the same Plan Box No. as the section can match. |
| GROUPBY.LOAD.DT.FROM | Default: true. When set, a trip with sections already planned must have a section with the same Loading Date From as the section. |
| GROUPBY.UNLD.DT.FROM | Default: false. When set, a trip with sections already planned must have a section with the same Unloading Date From as the section. |
| GROUPBY.LINK.ORDERS | Default: false. When set, the trip must have a section with the same Parent Document No., checked even when the trip has no sections yet. |
| BREAKBY.UOM | Optional. Must match one of the "Unit of Measure 1..6" fields on the TMS Setup. |
| BREAKBY.UOM.QUANTITY | Optional. The maximum quantity, for the unit of measure set in BREAKBY.UOM, that a trip may reach when the section is added. |
| STEPCODE.AFTER | Optional. An existing step code that runs on the trip after the section has been added. |