PrintECMDocumentIDLabelDialog

Description

Assigns a document ID (barcode) to a record (Business Central document) and prints a label/lead document.

If the ECMDocumentID is empty, the document definition is generated from the number series.

In addition, a Dialog Page for entering metadata is displayed. This is used by the Info Box.


Syntax

AL
[ErrorCode:= ] PrintECMDocumentIDLabelDialog(var TempECMJnlLine: Record "ECM Document Journal Line"; var ECMDocDef: Record "ECM Document Definition"; MainRecordVariant: Variant; var BarCode: Code[20]; ShowMessage: Boolean; CommitChanges: Boolean)


Parameters

Variable: TempECMJnlLine

Type: Record "ECM Document Journal Line" temporary

Used as a data object ("container") to pass data to a function, for all fields that need to be filled in the document items. By default, the document items are filled using the MainRecord and the document definition.

Filename, BLOB and MD5 hash are mandatory fields


Variable: ECMDocDef

Type: Record "ECM Document Definition"

ECM document definition for the record. The correct document definition for the record is searched for with the API function FindDocDefByRRef . Values different from or additional to the found document definition can be added to the record if needed.


MainRecordVariant

Type: Variant

MainRecord (record) is entered into the ECM queue and is required for processing the metadata.

Tip: The MainRecord can be passed as Record, RecordID or RecordRef.


Variable: BarCode

Type: Code

Contains the barcode


[Optional] ShowMessage

Type: Boolean

Set this parameter to TRUE if you want to display a message.


[Optional] CommitChanges

Type: Boolean

Set this parameter to TRUE if you want to set a commit after the release.




Return Value:

ErrorCode

Type: Integer

ErrorCode = 0, if the operation was successful.




Remarks:



Example: