Table of Contents

KVSKBAPostedDispatchHandling

Summary: Generates the Posted Dispatch Order report from Posted Dispatch Hand Header data.

Events

OnUpdateRequestPageSettings(Enum KVSKBADocumentInitEventType, Boolean, Integer, Boolean, Boolean, Option, Boolean, Boolean) :

Summary: Raised at multiple stages of request page initialization so that subscribers can read or modify report option settings.

[IntegrationEvent(true, false)]
local procedure OnUpdateRequestPageSettings(InitEventType: Enum "KVSKBADocumentInitEventType"; RequestPageAlreadyOpen: Boolean; var NoOfCopies: Integer; var ShowInternalInfo: Boolean; var PrintOnNotePaper: Boolean; var ShowItemTracking: Option; ShowComments: Boolean; var PrintSignatureBlock: Boolean): 

Parameters:

  • InitEventType: Identifies the lifecycle stage at which the event is raised (e.g. OnOpenPage, OnClosePage, OnBeforeOnPreReport, OnAfterOnPreReport).
  • RequestPageAlreadyOpen: Indicates whether the request page has already been shown to the user in the current session (managed via KVSKBADocDispSingleInstance).
  • NoOfCopies: The number of additional copies to print. Modifiable by subscribers.
  • ShowInternalInfo: Specifies whether internal information should be printed. Modifiable by subscribers.
  • PrintOnNotePaper: Specifies whether the report should suppress the company logo for pre-printed letterhead paper. Modifiable by subscribers.
  • ShowItemTracking: Controls item tracking display mode. Modifiable by subscribers.
  • ShowComments: Specifies whether comments should be printed. Note: this parameter is NOT passed by reference — modifications by subscribers will not affect the report's GlobalShowComments variable.
  • PrintSignatureBlock: Specifies whether the signature block should be printed. Modifiable by subscribers.

Remarks: Raised in OnOpenPage, OnClosePage, and OnPreReport (before and after applying DocumentDispSingleInstance.GetPrintWithLogo logic). Note: DispatchDestination, DispatchShowLevels, ShowTariffNo, ShowItemLevel and ShowDispHandlingLineGrossNetWeight are not exposed as parameters here.

OnBeforeSetLanguageFormatAddress(Record KVSKBAPostedDispatchHandHeader, Code[10], Boolean) :

Summary: Raised before the language code for FormatAddress is set from the posted dispatch handling header in DocHeader OnAfterGetRecord.

[IntegrationEvent(false, false)]
local procedure OnBeforeSetLanguageFormatAddress(DocHeader: Record "KVSKBAPostedDispatchHandHeader"; var LanguageCode: Code[10]; var IsHandled: Boolean): 

Parameters:

  • DocHeader: The posted dispatch handling header providing the language code.
  • LanguageCode: The language code from the header that will be passed to FormatAddress.SetLanguageCode. Modifiable by subscribers to override the language used for address formatting.
  • IsHandled: Set to true to skip the standard FormatAddress.SetLanguageCode(LanguageCode) call.

Remarks: Unlike other report events of this type, this event includes an explicit LanguageCode parameter (in addition to IsHandled) so subscribers can modify the code before it is applied. Note: there is no corresponding OnBeforeResetLanguageFormatAddress event in this report.

OnBeforeCheckDocStatusOnAfterGetRecord(Record KVSKBAPostedDispatchHandHeader, Boolean, Boolean) :

Summary: Raised in DocHeader OnAfterGetRecord before the document status is checked and PrintOutput is determined.

[IntegrationEvent(true, false)]
local procedure OnBeforeCheckDocStatusOnAfterGetRecord(var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var Handled: Boolean; PrintOutput: Boolean): 

Parameters:

  • DocumentHeader: The posted dispatch handling header being processed.
  • Handled: Set to true to skip the standard status check and PrintOutput logic.
  • PrintOutput: The current value of PrintOutput (true when not in preview mode). Modifiable by subscribers.

Remarks: Fires at the very start of DocHeader OnAfterGetRecord, before language, address and document header/heading processing. Use this event to override the PrintOutput flag or to validate document status before printing.

OnBeforeCreateDocumentHeader(Record KVSKBADocumentHeaderBuffer, Boolean, Record KVSKBAPostedDispatchHandHeader, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(true, false)]
local procedure OnBeforeCreateDocumentHeader(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var Handled: Boolean; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnBeforeCreateDocumentAddress(Record KVSKBADocumentHeaderBuffer, Boolean, Record KVSKBAPostedDispatchHandHeader, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(true, false)]
local procedure OnBeforeCreateDocumentAddress(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var Handled: Boolean; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnAfterCreateDocumentAddress(Record KVSKBADocumentHeaderBuffer, Record KVSKBAPostedDispatchHandHeader, Enum KVSKBADispatchDestination, Text[100], Text[100], Text, Text[100], Text, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(true, false)]
local procedure OnAfterCreateDocumentAddress(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; DispatchDestination: Enum "KVSKBADispatchDestination"; var DestinationAddr: Text[100]; var VendorAddr: Text[100]; var ShipToAddressCaptionText: Text; var ShipToAddr: Text[100]; var ShipToAddressText: Text; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnBeforeAddDocHeader(Record KVSKBADocumentHeaderBuffer, Record KVSKBAPostedDispatchHandHeader, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(true, false)]
local procedure OnBeforeAddDocHeader(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnBeforeCreateDocumentHeading(Record KVSKBADocumentHeaderBuffer, Boolean, Record KVSKBAPostedDispatchHandHeader, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(true, false)]
local procedure OnBeforeCreateDocumentHeading(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var Handled: Boolean; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnAfterCreateDocumentHeading(Record KVSKBADocumentHeaderBuffer, Record KVSKBAPostedDispatchHandHeader, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(true, false)]
local procedure OnAfterCreateDocumentHeading(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnPreDataItemDocHeaderText(Record KVSKBADocumentHeaderBuffer, Record KVSKBADocumentLineBuffer, Boolean, Record KVSKBAPostedDispatchHandHeader, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(true, false)]
local procedure OnPreDataItemDocHeaderText(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var DocumentLineBuffer: Record "KVSKBADocumentLineBuffer" temporary; var isHandled: Boolean; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnPostDataItemDocHeaderText(Record KVSKBADocumentHeaderBuffer, Record KVSKBADocumentLineBuffer, Record KVSKBAPostedDispatchHandHeader, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(true, false)]
local procedure OnPostDataItemDocHeaderText(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var DocumentLineBuffer: Record "KVSKBADocumentLineBuffer" temporary; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnDocFooterFinished(Record KVSKBADocumentHeaderBuffer, Record KVSKBAPostedDispatchHandHeader, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(true, false)]
local procedure OnDocFooterFinished(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnBeforeCheckForPageAndBlockBreak(Record KVSKBADocumentHeaderBuffer, Record KVSKBAPostedDispatchHandHeader, Record KVSKBAPostedDispatchHandlLine, Boolean, Boolean, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(false, false)]
local procedure OnBeforeCheckForPageAndBlockBreak(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var DocumentLine: Record "KVSKBAPostedDispatchHandlLine"; var skipLine: Boolean; var isHandled: Boolean; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnBeforeAddDocumentLine(Record KVSKBADocumentHeaderBuffer, Record KVSKBADocumentLineBuffer, Record KVSKBAPostedDispatchHandHeader, Record KVSKBAPostedDispatchHandlLine, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(false, false)]
local procedure OnBeforeAddDocumentLine(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var DocumentLineBuffer: Record "KVSKBADocumentLineBuffer" temporary; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var DocumentLine: Record "KVSKBAPostedDispatchHandlLine"; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnAfterAddDocumentLine(Record KVSKBADocumentHeaderBuffer, Record KVSKBADocumentLineBuffer, Record KVSKBAPostedDispatchHandHeader, Record KVSKBAPostedDispatchHandlLine, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(false, false)]
local procedure OnAfterAddDocumentLine(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var DocumentLineBuffer: Record "KVSKBADocumentLineBuffer" temporary; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var DocumentLine: Record "KVSKBAPostedDispatchHandlLine"; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnPreDataItemDispatchHandlingLine2OnDispatchShowlevels(Record KVSKBAPostedDispatchHandlLine, Enum KVSKBADispatchShowLevels) :

Summary: Raised in the DocLine2 OnPreDataItem trigger after the standard level/item filter has been applied, allowing subscribers to further modify the filter.

[IntegrationEvent(false, false)]
local procedure OnPreDataItemDispatchHandlingLine2OnDispatchShowlevels(var KVSKBADispatchHandlingLine: Record "KVSKBAPostedDispatchHandlLine"; KVSKBADispatchShowLevels: Enum "KVSKBADispatchShowLevels"): 

Parameters:

  • KVSKBADispatchHandlingLine: The DocLine2 data item record (KVSKBAPostedDispatchHandlLine). Use SetFilter/SetRange to add additional filters. Note: FilterGroup(2) has already been set by the standard logic.
  • KVSKBADispatchShowLevels: The current GlobalKVSKBADispatchShowLevels enum value that was used for the standard filter. Value only — modifying it will not affect the applied filter.

Remarks: The standard filter applied before this event depends on GlobalKVSKBADispatchShowLevels: "All Levels" filters out Document Line Type = Item when GlobalShowItemLevel is false; "Show Level 1" breaks the data item entirely unless GlobalShowItemLevel is true (in which case only Item lines are shown). Subscribers can use this event to apply additional or replacement filters on DocLine2 within FilterGroup 2.

OnBeforeAddShipmentMethod(Record KVSKBADocumentHeaderBuffer, Record Shipment Method, Boolean, Record KVSKBAPostedDispatchHandHeader, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(false, false)]
local procedure OnBeforeAddShipmentMethod(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var ShipmentMethod: Record "Shipment Method"; var isHandled: Boolean; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnAfterAddShipmentMethod(Record KVSKBADocumentHeaderBuffer, Record Shipment Method, Record KVSKBAPostedDispatchHandHeader, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(false, false)]
local procedure OnAfterAddShipmentMethod(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var ShipmentMethod: Record "Shipment Method"; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnBeforeAddShippingAgentInfo(Record KVSKBADocumentHeaderBuffer, Record Shipping Agent, Record Shipping Agent Services, Boolean, Record KVSKBAPostedDispatchHandHeader, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(false, false)]
local procedure OnBeforeAddShippingAgentInfo(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var ShippingAgent: Record "Shipping Agent"; var ShippingAgentServices: Record "Shipping Agent Services"; var isHandled: Boolean; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnAfterAddShippingAgentInfo(Record KVSKBADocumentHeaderBuffer, Record Shipping Agent, Record Shipping Agent Services, Record KVSKBAPostedDispatchHandHeader, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(false, false)]
local procedure OnAfterAddShippingAgentInfo(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var ShippingAgent: Record "Shipping Agent"; var ShippingAgentServices: Record "Shipping Agent Services"; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnAfterGetRecordCopyLoop(Record KVSKBADocumentHeaderBuffer, Record KVSKBAPostedDispatchHandHeader, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(false, false)]
local procedure OnAfterGetRecordCopyLoop(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnAfterGetRecordCopyLoop2(Record KVSKBADocumentHeaderBuffer, Record KVSKBAPostedDispatchHandHeader, Codeunit KVSKBAMasterDoc, Integer) :

[IntegrationEvent(false, false)]
local procedure OnAfterGetRecordCopyLoop2(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var MasterDoc: Codeunit "KVSKBAMasterDoc"; CopyLoopNumber: Integer): 

OnBeforeAddDocumentCommentLine(Record KVSKBADocumentHeaderBuffer, Record KVSKBADocumentLineBuffer, Record KVSKBAPostedDispatchHandHeader, Record KVSKBAPostedDispatchHandlLine, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(false, false)]
local procedure OnBeforeAddDocumentCommentLine(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var DocumentLineBuffer: Record "KVSKBADocumentLineBuffer" temporary; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var DocumentLine: Record "KVSKBAPostedDispatchHandlLine"; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnAfterAddDocumentCommentLine(Record KVSKBADocumentHeaderBuffer, Record KVSKBADocumentLineBuffer, Record KVSKBAPostedDispatchHandHeader, Record KVSKBAPostedDispatchHandlLine, Codeunit KVSKBAMasterDoc) :

[IntegrationEvent(false, false)]
local procedure OnAfterAddDocumentCommentLine(var DocumentHeaderBuffer: Record "KVSKBADocumentHeaderBuffer" temporary; var DocumentLineBuffer: Record "KVSKBADocumentLineBuffer" temporary; var DocumentHeader: Record "KVSKBAPostedDispatchHandHeader"; var DocumentLine: Record "KVSKBAPostedDispatchHandlLine"; var MasterDoc: Codeunit "KVSKBAMasterDoc"): 

OnBeforeGetOrderShipmentNo(Record KVSKBAPostedDispatchHandlLine, Code[20], Code[20], Text, Boolean) :

Summary: Raised before the order number, current shipment number, and prior shipment numbers are resolved for a posted dispatch handling line.

[IntegrationEvent(false, false)]
local procedure OnBeforeGetOrderShipmentNo(DispatchHandingLine: Record "KVSKBAPostedDispatchHandlLine"; var OrderNo: Code[20]; var ShipmentNo: Code[20]; var ShipmentNos: Text; var IsHandled: Boolean): 

Parameters:

  • DispatchHandingLine: The posted dispatch handling line for which shipment information is being determined.
  • OrderNo: The resolved sales or service order number. Set this value when handling the resolution.
  • ShipmentNo: The current posted sales or service shipment number. Set this value when handling the resolution.
  • ShipmentNos: The formatted prior shipment numbers text. Set this value when handling the resolution; it is later written as a comment line when it is not empty.
  • IsHandled: Set to true to bypass the standard source-document lookup and prior-shipment calculation. The subscriber must populate any required output parameters before setting this value.

Remarks: Fires at the start of GetOrderShipmentNo, before the output parameters are cleared. The standard logic obtains the order and current shipment number from the source document, then formats other posted shipments for the same order line as bold HTML. This method is used while processing Level 2+ dispatch lines to populate their order/shipment fields and determine whether a prior-shipments comment line is added.

OnAfterGetOrderShipmentNo(List, Record KVSKBAPostedDispatchHandlLine, Code[20], Code[20], Text) :

[IntegrationEvent(false, false)]
local procedure OnAfterGetOrderShipmentNo(AlreadyPostedShipmentNos: List; DispatchHandingLine: Record "KVSKBAPostedDispatchHandlLine"; var OrderNo: Code[20]; var ShipmentNo: Code[20]; var ShipmentNos: Text): 

OnBeforeAddShipmentNosAsDocLine(Text, Boolean) :

Summary: Raised before prior shipment numbers are added as a comment line to the master document.

[IntegrationEvent(false, false)]
local procedure OnBeforeAddShipmentNosAsDocLine(ShipmentNos: Text; var IsHandled: Boolean): 

Parameters:

  • ShipmentNos: The formatted prior shipment numbers text that would be added to the document.
  • IsHandled: Set to true to suppress the standard comment-line creation. When set, the subscriber is responsible for adding any replacement content.

Remarks: Fires in AddShipmentNosAsDocLine before the empty-text check and before the document line buffer is initialized. The method is called only for Level 2+ dispatch lines after GetOrderShipmentNo returns prior shipment text. If not handled and ShipmentNos is not empty, the standard logic writes it as a CommentLine in the MainTableDispatchHandling2 section.

OnAfterAddShipmentNosAsDocLine(Text) :

Summary: Raised after prior shipment numbers have been added as a comment line to the master document.

[IntegrationEvent(false, false)]
local procedure OnAfterAddShipmentNosAsDocLine(ShipmentNos: Text): 

Parameters:

  • ShipmentNos: The formatted prior shipment numbers text written by the standard logic.

Remarks: Fires in AddShipmentNosAsDocLine only when ShipmentNos is not empty and OnBeforeAddShipmentNosAsDocLine did not set IsHandled to true. It fires after OnBeforeAddDocumentCommentLine, MasterDoc.AddDocLine, and OnAfterAddDocumentCommentLine. Use this event for follow-up processing that requires the standard prior-shipments line to exist.

Protected Variables

GlobalPrintOnNotePaper

Type: Boolean

GlobalPrintSignatureBlock

Type: Boolean

GlobalShowComments

Type: Boolean

GlobalShowDispHandlingLineGrossNetWeight

Type: Boolean

GlobalShowInternalInfo

Type: Boolean

GlobalShowItemLevel

Type: Boolean

GlobalShowTariffNo

Type: Boolean

GlobalDispatchDestination

Type: Enum (KVSKBADispatchDestination)

GlobalKVSKBADispatchShowLevels

Type: Enum (KVSKBADispatchShowLevels)

GlobalNoOfCopies

Type: Integer

GlobalShowItemTracking

Type: Option