Hi,
We need to allow (in some circumstances) for a sales order to over ship. To do so, we need to be able to update the quantity automatically when the qty. to ship entered by the user is greater than what's left to ship. The order is already released and the user should not have to reopen it manually, change the quantity and release it again. All this process must be transparent to the user.
With the new A/L language, I'm having a hard time figuring out how to achieve this. I subscribed to the event OnValidateQtyToShipAfterInitQty from the Sales Line table where I'm adding code to go update the quantity. This needs to be validated as the amounts must be updated as well. But the validation is checking if the sales order is open which it is not. I tried calling the SuspendStatusCheck function to skip the validation but it's then failing in the UpdateAmounts function. I tried reopening the order in my event subscriber, but since the sales header is not passed as a variable, once the validation goes to the UpdateAmounts function, the GetSalesHeader function is called and the status is back to released. Then I tried to also subscribed to the OnBeforeUpdateAmounts event and set the IsHandled to true so the base code is skipped. I copied the code from base and skipped the error message on the status, but for some reason, when I call the UpdateVATAmounts and InitOutstandingAmounts function from that event subscriber, the base code is not executed at all. So the quantities are updated properly but not the amounts and taxes
What am I missing? Any help would be greatly appreciated.
-Julie