ECMRepositoryRequestWithFindDocDefByRRef

Description

Searches an ECM document definition by table number, table document type and start date.

Table number, table document type and start date are extracted from the MainRecord (Variant) using the "ECM Object Reference Matrix" setup.

Creates an entry in the ECM queue and sets the status in the ECM queue from started to pending.

Unification of the functions FindDocDefByRRef, ECMRepositoryRequest and ReleaseECMRepositoryRequest in one function.


Syntax

AL
[FoundDocDef:= ] ECMRepositoryRequestWithFindDocDefByRRef(MainRecordVariant: Variant; PurposeofUse: Enum "ECM Purpose Of Use"; ReportID: Integer; ReporttoECMQueue: Enum "ECM Report to ECM Queue"[; SuppressReleaseECMQueue: Boolean] [; SupressPreparePDFMetaImmediately: Boolean]; var TransactionNo: BigInteger; var ErrorCode: Integer)


Parameters

MainRecord

Type: Variant

With this MainRecord (record) and the function FindDocDefByRRef the document definition is found and the record is entered into the ECM queue for the preparation of the metadata and the PDF creation.


PurposeofUse

Type: Enum "ECM Purpose Of Use"

With the purpose the search can be limited.

First the ECM document definition with exactly this purpose is searched.

If no ECM document definition was found: If the purpose is empty (PurposeofUse::" " ), the filter will be removed from the Purpose field and another search for an ECM document definition (without PurposeofUse) will be started.

Otherwise, the filter is set to the PurposeofUse field, changed to PurposeofUse "empty" and then a FINDLAST ECM document definition is executed again. (E.g. from "PurposeofUse::Report" to "PurposeofUse::").

For combinations of purpose, for example "Assignment & File", as an intermediate step, if the ECM document definition is not found, first the combinations are resolved for filtering. First the filtering is done according to the assignment, then according to the file. In last instance with the filter purpose "empty".


ReportID

Type: Integer

Report ID is not used to search for an ECM document definition, but only to search for a different document category. If the field "Use passed report" has been checked in the ECM document definition, this report will be used for further processing.


ReporttoECMQueue

Type: Enum "ECM Report to ECM Queue"

Filter on the field "Add report to ECM queue" in the ECM document definition. This filter is only used if the variable PurposeofUse " ECM Purpose Of Use " is passed with the value Report.

Default value: enum:: "ECM Report to ECM Queue"::Always.

The interface uses this parameter for the EventSubscriber (e.g. for the codeunits ArchiveManagement), there we pass as parameter enum:: "ECM Report to ECM Queue":: "Event".

With this, the entry into the ECM queue can be controlled in the ECM document definition via the field "Enter report into ECM queue".


[Optional] SuppressReleaseECMQueue

Type: Boolean

Set this parameter to true if you do not want to execute ReleaseECMRepositoryRequest


[Optional] SupressPreparePDFMetaImmediately

Type: Boolean

Set this parameter to true if you do not want to run the "Prepare PDF/metadata immediately" option.


Variable: TransactionNo

Type: BigInteger

ECM queue transaction no. that will be returned.


Variable: ErrorCode

Type: Integer

ErrorCode that is returned.



Return Value:

Success:

Type: Boolean

True if the function was executed successfully, otherwise False.

FoundDocDef = true, ErrorCode = 0 and TransactionNo <> 0, if the operation was successful.



Remarks:



Example: