Symptom
When you choose Add & View for a marketing document that is subject to an approval process (for example, purchase order), even though the draft is created successfully, you receive the following error message: "No matching records found 'XXXXX' (OXXX) (ODBC -2028) [Message 131-183]." If you choose Add & View again, multiple drafts are created.
When you choose Add & View for a marketing document that is duplicated and triggers the approval procedure, a wrong document with the wrong approval status is created.
Reproducing the issue
Prerequisites:
- In SAP Business One, you have enabled the approval process in Administration → System Initialization → General Settings → BP tab.
- You have created an approval template for the marketing documents.
Scenario 1:
- Go to Administration → System Initialization → General Settings → BP tab and select Enable Updating the Document Generated/Updated by Approval Process.
- Create a market document that is subjected to an approval procedure.
- Choose the Add & View button.
- The draft is created and you receive the following error message: No matching records found.
- Choose Add & View again; the same error message is displayed again.
Expected behavior:
When the draft is created for the first time, a message states that the draft has been generated.
When you choose Add & View a second time, a warning message is displayed and no more draft are created.
Actual behavior:
Multiple drafts are created when you keep choosing Add & View.
Scenario 2:
- Go to Administration → Approval Process → Approval Templates, define an approval template as follows:
Originator → Use A001
Documents → Purchase Order
Authorizer → user manager
Terms → When the Following Applies: Discount % Greater or Equal 10
(Note: this issue will not occur if you define the Terms as Always) - Create a purchase order with a discount of 20%.
- Log in to the company with user A001.
- Open the purchase order created in step 2.
- Duplicate the purchase order and enter a vendor code.
- Set the Discount % as 20% and choose Add & View.
- The draft is created and sent for approval. An error message appears: "No matching records found 'Purchase Order' (OPOR) (ODBC -2028) [Message 131-183]".
- Choose Add & View again.
Expected behavior:
When you add the purchase order and trigger the approval process, no error message is displayed, and you cannot choose Add & View again.
Actual behavior:
A purchase order (not the draft) is created with the status Document Update [Pending].
This purchase order cannot be canceled, closed, or copied to a target document.
There is no approval record for this purchase order in the Approval Status Report or Approval Decision Report.
Workaround:
Choose the Add & New or Add & Close button instead.