IDM Document Workflow Example

This example explains the OrderVerificationReport background task. It is one of the predefined document workflows. When a user prints a customer order, the OrderVerificationReport task runs. When that task completes, this workflow runs, and the order PDF file is sent to Document Management, along with metadata that identifies it, so that users can easily find this specific document in Document Management.

If you generate the report and look at the background task parameters in the Active Background Tasks form, you see a list of comma-separated parameters. Within these parameters, the value of the customer order is listed and labeled StartingOrderNumber=. The process described below parses the background task parameters to extract the actual customer order number and uses that to look up additional values related to the customer order, which are then used during insertion of the document into the Document Management app.

After it gets the order number, the workflow uses the specified IDO (SLCos) to get additional information about the order. This information is passed to Document Management as metadata for filtering:

  • Order number
  • Customer number
  • Related customer PO number (if available)
  • Related estimate number (if available)

The workflow determines where to store the document file in Document Management based on the information you provide about the external document type (CS_SalesOrder) and entity type (InforSalesOrder). You can set up a document description that uses values from the KeyText variables to make the description useful, for example 4677103_InforSalesOrder.

This table explains the values that are defined in the OrderVerificationReport workflow, shown when you select the Advanced check box::

Field Value Description
TaskName OrderVerificationReport TaskName appearing in the Background Task Definitions form.
vKeyText01 OrderStarting= Search string start. This start and end logic provides the value between the strings as the actual number. This handles cases, for example customer orders, where expand keys are used..
vKeyText02 OrderEnding= Search string end.
vKeyText03 INSTR(E(eTaskParms1), V(vKeyText01)) + LEN(V(vKey- Text01)) Find the starting position of OrderStarting= in the TaskParms1 string.

For example, if eTaskParms1 is “OrderStarting=B0001, OrderEnding=E0005,….”, the start position is B.

vKeyText04 INSTR(E(eTaskParms1), V(vKeyText02)-1) – V(vKeyText03) Calculate the length of the OrderStarting value.

For example, if eTaskParms1 is “OrderStarting=B0001, OrderEnding=E0005,….”, the result is the string length of B0001, which is 5.

vKeyText05 SUBSTRING(E(eTaskParms1),V(vKeyText03),V(vKeyText04)) Find the value of OrderStarting.

Using the above example, the value is B0001.

vKeyText06 DBFUNCTION("ExpandKyByType", "CoNumType", V(vKeyText05)) Function expands the order number as needed, for example, "4677103" (vKeyText05) to " 4677103" (vKeyText06).
vIdoName SLCos Name of the IDO that contains data for CoNum.
vIdoFilter SUBSTITUTE("CoNum='{0}'", V(vKeyText06)) The filter looks in the IDO for a record where, for example CoNum=’ 4677103’ if the vKeyText06 field evaluates to “ 4677103’.
vIdoPropertyList CustNum,CoNum,CustPo,EstNum, List of IDO properties that belong to the IDO listed in vIdoName. The document will be tagged with attributes that match these IDO property values.
vExtDocName CS_SalesOrder Document Management document type that is used to store the submitted document.
vExtMsgEntity InforSalesOrder Infor Ming.le EntityType that is used in JSON messages.
vExtDocDescription SUBSTITUTE("{0}_{1}", V(vKeyText06), V(vExtMsgEntity)) Function that is used to create meaningful document descriptions in the form of “ 4677103_InforSalesOrder” if vKeyText06 evaluates to CoNum=” 4677103”.