There are two ways to populate the Additional References:
The first solution can be used when the additional references are stored on a source document (line).
The second one is a generic approach when the additional references are genericThe transport order contains several additional reference fields that are by default included in the API communication with the providers.
For instance, the Service Point (Ref) on the Transport Order is included in the API with the different providers.
However, in Business Central there is no business logic that populates the additional references by default.
The fields have to be populated by customizations.
This topic explains how an additional reference field can be populated.
*Not all reference fields are supported by all the providers
Another common question is how custom fields can be populated on the Transport Order (Header).
These new fields are typically populated with data from a certain source document or source document line.
When the additional references or custom fields are derived from a source document (line), like a sales order (line), then the OnBeforeFinalizeFrom* events in the IDYS Publisher codeunit (11147685) can be used.
(See a full list of those events further on in this topic).
These events have the source document (line) as a parameter and the transport worksheet line as a var parameter. In this scenario the Additional References field should , so the field can be copied from the source document (line) to the transport worksheet line. Later on the information
The additional references that exist on the transport order header, also exists as fields on the transport worksheet lines.
Populating the additional references on the transport worksheet line, will automatically populate the same field on the created transport order.
For custom fields on the transport order it is recommended to add the same field to the transport worksheet line table as well and then use the same events to populate them.
With the OnBeforeCreateTransportOrderLines event of the “IDYS Create Tpt. Ord. (Wrksh.)” codeunit the information can then be copied from the transport worksheet line to the transport order.
In the version 22.10.2398.0 4 new events have been introduced that make it easier to customize the transport order:
OnBeforeInsertTransportOrder
OnTransportOrderCreated
OnBeforeInsertTransportOrderLine
OnAfterInsertTransportOrderLine
With the events listed below, the new field on the “IDYS Transport Worksheet Line” can then be populated with a value based on the Source Document or Source Document Line.
The following events exists:
procedure OnBeforeFinalizeFromSalesOrderLine(SalesLine: Record "Sales Line"“Sales Line”; var TransportWorksheetLine: Record "IDYS “IDYS Transport Worksheet Line"Line”)
procedure OnBeforeFinalizeFromSalesReturnOrderLine(SalesLine: Record "Sales Line"“Sales Line”; var TransportWorksheetLine: Record "IDYS “IDYS Transport Worksheet Line"Line”)
procedure OnBeforeFinalizeFromPurchaseReturnOrderLine(PurchaseLine: Record "Purchase Line"“Purchase Line”; var TransportWorksheetLine: Record "IDYS “IDYS Transport Worksheet Line"Line”)
procedure OnBeforeFinalizeFromServiceOrderLine(ServiceLine: Record "Service Line"“Service Line”; var TransportWorksheetLine: Record "IDYS “IDYS Transport Worksheet Line"Line”)
procedure OnBeforeFinalizeFromTransferOrderLine(TransferLine: Record "Transfer Line"“Transfer Line”; var TransportWorksheetLine: Record "IDYS “IDYS Transport Worksheet Line"Line”)
procedure OnBeforeFinalizeFromWarehouseShipmentLine(WarehouseShipmentLine: Record "Warehouse “Warehouse Shipment Line"Line”; var TransportWorksheetLine: Record "IDYS “IDYS Transport Worksheet Line"Line”)
procedure OnBeforeFinalizeFromPostedSalesShipmentLine(SalesShipmentLine: Record "Sales “Sales Shipment Line"Line”; var TransportWorksheetLine: Record "IDYS “IDYS Transport Worksheet Line"Line”)
procedure OnBeforeFinalizeFromReturnShipmentLine(ReturnShipmentLine: Record "Return “Return Shipment Line"Line”; var TransportWorksheetLine: Record "IDYS “IDYS Transport Worksheet Line"Line”)
procedure OnBeforeFinalizeFromServiceShipmentLine(ServiceShipmentLine: Record "Service “Service Shipment Line"Line”; var TransportWorksheetLine: Record "IDYS “IDYS Transport Worksheet Line"Line”)
procedure OnBeforeFinalizeFromTransferShipmentLine(TransferShipmentLine: Record "Transfer “Transfer Shipment Line"Line”; var TransportWorksheetLine: Record "IDYS “IDYS Transport Worksheet Line"Line”)
procedure OnBeforeFinalizeFromPostedReturnReceiptLine(ReturnReceiptLine: Record "Return “Return Receipt Line"Line”; var TransportWorksheetLine: Record "IDYS “IDYS Transport Worksheet Line"Line”)
If you create transport orders automatically during the posting of source documents, then you’ll need the events that are based on posted document lines.
If transport orders are manually manually from unposted documents, then the first set of events can be used.
...