Create triggers
You can use triggers to automatically assign documents to workflows according to field values. For example, you can make a trigger based on the document amount, so documents with high amounts are handled by a workflow with users that are authorized to approve high amounts. Triggers are activated after a document is verified.
You can create three types of triggers:
-
Correction triggers - Start Correction workflows. Correction triggers are run in the order they appear (from top to bottom) on the Triggers tab. Correction triggers are run before sending a document to the target system. Correction triggers are also run before document registration if Perform registration step is enabled in the Process control settings.
-
Coding & approval triggers - Start Coding & approval workflows. After a document passes the correction triggers, coding & approval triggers, if any exist, are run in the order they appear. Documents without validation errors that do not satisfy any of the conditions of any triggers are sent to the Default coding & approval workflow. Coding & approval workflows are initiated based on the Process control settings.
- If Perform registration step is enabled, approval workflows start after correction.
- If the Perform registration step is not enabled, approval workflows start after verification.
-
Rejection triggers - Start Rejection workflows. If your solution uses custom rejection codes, rejection triggers are run after a document is rejected by an AP Essentials Office user.
To create a trigger using Admin Center:
- Navigate to the Workflow view and select Edit.
- Select the Triggers tab and specify the Default coding & approval workflow that you want to use if no trigger is activated, or select Manual start if you want to assign workflows manually when a document is opened for approval. Select Manual start if you do not use triggers.
-
Select one of the following:
- Add CODING & APPROVAL TRIGGER
- Add CORRECTION TRIGGER
- Add REJECTION TRIGGER
- In the dialog box, type a descriptive name in the Name box.
- Select the workflow that you want to trigger in the Start workflow list.
- Select Add to create a condition.
-
Specify the conditions of the trigger using the available settings.
This step varies depending on whether you create a Correction trigger, Coding & approval trigger, or Rejection trigger. However, the concept is the same.
- Correction trigger: Select a field or validation rule in the Name setting. The Name determines what appears in the Parameter list.
- Coding & approval trigger: Select a field type in the Fieldtype setting. The Fieldtype determines what fields appear in the Field list.
- Rejection trigger: The Fieldtype and Field settings are set to Reject code and cannot be changed.
Use the Operation setting and the adjacent box to determine how the value of the field is evaluated. When the condition is true, the document is assigned to the workflow you select in the Start workflow list.
If you select In list or Not in list in the Operation setting, a link appears that you can select to specify a list of values that you want to evaluate.
You can create up to 10 conditions.
-
Select OK to return to the previous
view.
The newly created trigger appears in the list.
- If you have more than one trigger, select the row of the newly created trigger and use the up and down buttons to arrange the order in which the triggers are run.
- Select Save to save your changes.
Special considerations for correction triggers
Correction only runs when all of the following conditions are met.
- A validation rule is enabled for Workflow in the Extraction service.
- The corresponding correction trigger condition evaluates to true.
- A validation error exists on the invoice after verification or after an approval workflow.
When you create a correction trigger, consider the following:
-
Is Perform registration step enabled?
Correction triggers can run before document registration and before sending a document to the target system. However, if Perform registration step is not enabled, correction triggers run only before the document is sent to the target system.
-
Is the validation rule enabled for Workflow?
If the correction trigger condition uses a validation rule, that validation rule must be enabled for Workflow in the Extraction service. Enabling the rule only for Verify does not activate a correction trigger.
Example: Validation rule enabled only for Verify
Assume you create a correction trigger that uses a validation rule, but the validation rule is only enabled for Verify.
The trigger is not run because the validation rule is not evaluated during workflow operations. Consequently, the trigger condition is never met and the trigger does not start its workflow.
To run the correction trigger during workflow operations, enable the validation rule for Workflow.
Example: Perform registration step is not enabled
Assume you create a correction trigger that uses a validation rule that is enabled for Workflow, but Perform registration step is not enabled.
The trigger runs before sending a document to the target system. However, it does not run before document registration because the registration step is not performed.
If you enable Perform registration step, the correction trigger runs both before document registration and before the document is sent to the target system. Which options you choose depends on your system requirements.