Applies to Product – Microsoft Dataverse
What’s happening?
Sales orders are not closing as expected after the canceled quantity on sales order details is filled.
Reason:
This may arise due to the requirement that if work is associated with a sales order, the sales order cannot be canceled until the work is canceled and reversed. This requirement applies even if the work associated with the sales order is closed.
Resolution:
To resolve this, follow these steps:
1. Cancel the work associated with the sales order and put the inventory back into the desired location.
2. Go to the relevant load of the sales order.
3. Select either Reduce picked quantity on the load line or the appropriate work option on the Action Pane.
4. The work will then have a status of Canceled, and new inventory movement work will be automatically created to put inventory back into the specified location.
5. Delete the load if necessary.
6. The shipment will also be updated accordingly.
7. After completing these steps, you should be able to go to the sales order and cancel it successfully.
If the issue persists, ensure that the JavaScript function associated with the custom cancel button is correctly configured: - Verify that the function name matches a valid function name in the JavaScript web resource. - Ensure the path refers to a valid JavaScript web resource and is prefixed correctly. - Check that the JavaScript function is receiving the expected parameters and that the parameters are declared with the correct type and in the correct order.
If further assistance is needed, consider debugging the JavaScript using the browser's developer tools to ensure the function is triggered correctly.
