Scripting

  • 1.  I have a script as Table-Pre-Write on SO Invoice H

    Posted 06-15-2015 08:11
    I have a script as Table-Pre-Write on SO Invoice Header. If terms are ""00"" & Net Invoice <> 0 then, it will give an error message & not allow the write. If the deposit amount is filled in completely before clicking Accept, it works. If the deposit amount doesn't cover the Invoice Total, it gives the error, which is correct. However, if I then fix the Deposit amount to equal the Invoice Total, is still thinks its the original Deposit Amt, not the updated. How do I get it to recognize the change? I would think it being a PreWrite on the Table, it would re-evaluate the entire script every time Accept is clicked, no?


  • 2.  RE: I have a script as Table-Pre-Write on SO Invoice H

    Posted 06-15-2015 09:44
    You are correct! Can you DebugPrint the NetInvoice and Deposit amounts to see if the system is giving you the correct values?


  • 3.  RE: I have a script as Table-Pre-Write on SO Invoice H

    Posted 06-15-2015 10:55
    @DanaYoung can you be more specific about the error message? Is this a message you are sending to the user, or is this a Sage error message? Also, what is the desired outcome if the terms=""00"" and NetInvoice <> 0?


  • 4.  RE: I have a script as Table-Pre-Write on SO Invoice H

    Posted 06-15-2015 11:06
    Prolly you need to get the value from the control instead of the field. There's an example of how to use UIObj in an event script from a script snippet I posted a few weeks ago to John Wilder's question.


  • 5.  RE: I have a script as Table-Pre-Write on SO Invoice H

    Posted 06-15-2015 11:17
    Sorry, I thought I deleted this comment because I figured it out, but when I came back it errored on the delete. It was the type of msg that I was displaying. I was setting it to ReadOnly. When I changed it to SetError it works now. Thanks for the help anyways!