AssignDocumentID

Description

Assigns a document ID (barcode) to a record (BC document).

If PrintECMDocumentIDLabel = true a label/lead document is printed.

If ECMDocumentID (Barcode) is empty, the ECMDocumentID (Barcode) is generated from the number series.

[Additional parameters can be passed via ECM Document Journal Line].


Syntax

AL
[ErrorCode:= ] AssignDocumentIDDialog(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 with the API function FindDocDefByRRef . Values deviating from or additional to the found document definition can be added to the data set if required.


MainRecordVariant

Type: Variant

MainRecord (record) is entered into the ECM queue and is needed for processing (metadata and PDF creation).

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


Variable: BarCode

Type: Code

A specific barcode can be transferred here (e.g. document number). If this field is empty, a barcode from the number series will be drawn from the ECM vertical solution matrix.


[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 and TransactionNo <> 0, if the operation was successful.

With the function "ShowMessage" the ErrorCodes can be displayed and with the function "WriteLog" ErrorCodes can be logged.



Remarks:



Example: