3367419 - Approval procedure not triggered after update of existing sales order
An approval procedure is not triggered when you update an existing Sales Order.
SAP Business One
Reproducing the Issue
In the Approval Template Setup window, you have selected the option Active When Updating Documents Not Generated by Approval Process.
1. Create the following query:
SELECT 'true' WHERE (SELECT count(*) FROM ORDR T0 WHERE T0.[DocNum] = $[ORDR.DocNum]) > 0
or when using SAP HANA, use the following query:
SELECT 'true' from DUMMY WHERE (SELECT count(*) FROM ORDR T0 WHERE T0."DocNum" = $[ORDR."DocNum"]) > 0
2. Define an Approval Stage, with the authorizer as, e.g user A001.
3. Define an Approval Template:
- On the Document tab, select Sales Order.
- Select the Approval Stage from Step 2.
- Select the query on the Term tab.
4. Find an existing Sales Order which was not involved previously in the approval process. Edit one or more fields, e.g. Remarks.
The system triggers the Approval Process.
The Approval Process is not triggered and the Sales Order can be saved with the changes.
As the user-defined query only has a docnum, and the docnum is not changed, the approval process is not triggered.
If you expect the system to trigger the approval process in update mode, you need to put the changed field used to trigger the approval process in the user-defined query.