Scripting

  • 1.  I have a new problem related to my post below on a

    Posted 01-19-2016 13:41
    I have a new problem related to my post below on a simple script that calculates gross profit based on standard cost. The script works great for newly-entered orders and invoices, but when the user copies from another open or completed order, the Profit % UDF first shows as blank, and then if the user changes the Unit Price or Quantity, the UDF displays 100%, regardless of true calculation. Is there anything I can do to the script to ensure that it at least recalculates correctly upon changing the quantity or price, or is this better handled by a button script to force a recalc of all lines after copy or before accept?


  • 2.  RE: I have a new problem related to my post below on a

    Posted 01-19-2016 15:11
    You are right, copying an order will not trigger the line fields when they are taken from the source order. However, the S/O Detail Table Post Write event is triggered with the Copy and you could use it to loop through and recalculate all of your line UDF's.


  • 3.  RE: I have a new problem related to my post below on a

    Posted 01-19-2016 16:12
    Thank you so much, Dan. I will read up on that event.