@Sage100Routine
This is from @MarcCregan
Hi there,
I am trying to validate a customer UDF when moving from the lines tab to the totals tab in Sales Order. I have setup a checkbox udf on the customer (UDF_PolandCheckBox). I am basing my script on the 'So_Header_Line_Discount.txt' script we did in the scripting class prior to Meeting of the Minds this year. This script added up the detail lines, then calculated a discount amount if the order was over 1000.00.
I am trying to do something similar, but only add in the new line and amount if the customer UDF checkbox is checked. First question is how do I pull in the customer UDF value to the script? I tried retval = oBusObj.getvalue(""UDF_POLANDCHECKBOX$"",nPVATValue) but always get a return value of 0.
Second question is what is the normal return value of a check box? Is it Yes/No, 0/1 or some other value? Should my variable be a string, numeric or Boolean? The blue highlighted lines below are my attempt at solving this, but don't return anything but 0.
Attached is my slightly modified script.