Hello everyone,
I found a unique scenario in which my commission script will be required.
When a Special PO needs to be created, you are able to adjust the Purchase Price of the item (rate/amount on the PO form). After you save your PO, you'll be taken back to the Sales Order.
When I land on this page, I am in "view" mode. When I review the line items, I can see that the profit margin changed, but the commission values have not been assigned. It will fix itself in 'edit mode' but we need it to update before returning back to the Sales Order.
I need to have those value readjusted before coming back to this page.
I did try an afterSubmit function to pull the SO and integrate the commission script to run. But I get this error: .getLineItemValue is not a function
Is it possible for me to use the Pageinit script on sales orders in view mode?