GetFieldValueFromFirstEntry in a workflow template

Business requirement

Customer has different approval workflow requirements depending on the first entry in a batch. This is used to determine if the G/L batch is a Journal Entry batch , or a RR batch if the G/L Batch comes from PJC. They also have different approval requirements for A/R credit note batches.

key learnings

The workflow action GetFieldValueFromFirstEntry saves the value in the configured field name in a workflow value.

The workflow value can then be used to evaluate what approval branch to follow.

Important: This returns the value of the first entry / document in the batch.

Example

Example 1 – G/L Batch and G/L Journal

A screenshot of a computer

AI-generated content may be incorrect.

With the workflow action, you can save the Source Type for the first GL Journal Header in a workflow value and use the value in subsequent steps.

Parameters for workflow action

  • ViewID: GL0006 for G/L Journal Headers

  • ViewField: SRCETYPE

  • Workflow Var: Name of the workflow value to save the value: WFSRCETYPE (you can change this to other workflow variable).

  • In the screenshot above, the WFSRCETYPE value will be set to AP

 

 

Using the action and workflow value

You can then use the Evaluate action, for the WFSRCETYPE field and determine which action to take if True/False (e.g. if Source Type = JE, submit for approval, if not, auto-complete the workflow, no approval required).

Make the batch ready to post, the workflow starts, and the Source Type on the G/L Journal Header is saved in a workflow value

A screenshot of a computer

AI-generated content may be incorrect.

Using the Source Type in the first line of the first entry

Use ViewID GL0010 to save the value for the configured field in the first line in the first entry of the G/L Journal Batch.

A screenshot of a computer

AI-generated content may be incorrect.

 

Example 2 – A/R Invoice Batch

A screenshot of a computer

AI-generated content may be incorrect.

 

Workflow is  attached to the A/R Invoice Batches (AR0031 / ARIBC) view.

You can use the workflow action to save values from the first invoice in the batch using ARIBH / AR0032 or the first line of the first invoice, using AR0033/ ARIBD.

Use Extender Inquiries > View Info to check the field name you want to use.

Configuration to determine if the first document in the A/R batch is a credit note

Use Workflow Action: GetFieldValueFromFirstEntry with the following parameters

  1. View ID = AR0032 / AR Invoices

  2. VIewField: TEXTTRX

  3. Workflow Var: WFTEXTTRX (or whatever workflow value name you want, it needs to match what is in subsequent actions or in email message templates).

A screenshot of a computer

AI-generated content may be incorrect.

 

A screenshot of a computer

AI-generated content may be incorrect.

 

If the first document in the batch is a credit note  (Item or Summary), the action will save the first document type as 3 in the WFDOCTYPE . In the sample workflow above, we evaluate the WFDOCTYPE and save a value “First doc is a credit note”.

 

If the first document in the batch is an invoice or a debit note ”  (Item or Summary), the action will save the first document type as 1 in the WFDOCTYPE .

 

A screenshot of a computer

AI-generated content may be incorrect.

A screenshot of a computer

AI-generated content may be incorrect.