Extending Document Layout Selection when Posting
Document Central can be extended with code that allows changing the document layout used during the posting process. This is accomplished by utilizing events provided by the Document Central extension. The following documentation explains how to use the events provided by the Document Central extension to modify the document layout during the posting process.
An event is provided that enables the change of document layouts based on a specific value in the record. The following event should be created in an event subscriber codeunit where the 'Values' responsible for the change of the document layout are checked. The following code is an example that would change the document layout to MS-1304-BLUESIMPLE when the Location Code of the Sales Quote is BLUE.
Event OnBeforeSetDefaultDocumentLayoutDuringPostingProcess
This Event can be used to change the used document layout during the posting process when no Custom Document Layout was configured for the Customer/Vendor. The following parameters are provided by the event:
Info
When posting/converting a document without configured custom document layouts behind the respective master data (usually customer or Vendor), only 1 report is archived in the Document Central.
Name | DataType | Lenght | Description |
---|---|---|---|
ParamDocumentLayoutCode | Code | 20 | Specifies the Document Layout that was determined by Document Central Setting up Custom Report Layouts |
ParamRecordRef | RecordRef | Specifies the source record where the posting was executed | |
ParamReportNoInteger | Integer | Specifies the Report No of the Report | |
ParamLayoutChangedBoolean | Boolean | Specified whether the Document Layout was changed by the Event |
Event OnBeforeSetCustomDocumentLayoutDuringPostingProcess
This Event can be used change the used document layouts during the posting process when Custom Document Layout where configured for the Customer/Vendor. The following parameters are provided by the event:
Info
When posting/converting a document, all configured Custom document layouts behind the respective master data (Usally Customer or Vendor) are archived in the Document Central.
Name | DataType | Lenght | Description |
---|---|---|---|
ParamDocumentLayoutCode | Code | 20 | Specifies the Document Layout that was determined by Document Central Setting up Custom Report Layouts |
ParamRecordRef | RecordRef | Specifies the source record where the posting was executed | |
ParamReportNoInteger | Integer | Specifies the Report No of the Report |