Hi All,
Working on a simple script in Purchase order. I have added a checkbox UDF to the Purchase order header called StockOrder. I then added it to the customizer so I can see the check box on the Header tab of the Purchase Order Entry screen.
Next I wrote a simple script as follows:
sCheckbox = """"
retval = oScript.DebugPrint(""You just changed the check box value on the header"")
retval = oBusObj.GetValue(""UDF_STOCKORDER$"",sCheckbox)
retval = oscript.debugprint(""Header Checkbox value is now "" & sCheckbox)
Then I assign it to the Po Purchase Order Header on the Column-PreValidate event and the field is the UDF_STOCKORDER. So basically when that field is changed, write the value to the debugger screen.
This works properly. in the debug screen i'll see it tell me the value is now Y or N as I check and uncheck it. So far so good right?
next I create another script as follows:
retval = oScript.DebugPrint(""START Detail value of check box Script"")
retval = oScript.debugprint(""A new detail was just entered lets check the value of the StockOrder Header Checkbox . . ."")
sCheckbox = """"
retval = oBusObj.GetValue(""UDF_STOCKORDER$"",sCheckbox)
retval = oscript.debugprint(""The detail level sees the StockCheckBox value as **"" & sCheckbox & ""**"")
retval = oScript.DebugPrint(""END Detail value of check box Script"")
Again pretty basic. I assign this one to the PO Purchase Order Detail table on the Column-prevalidate event. I attached it to the ExtensionAmt field (I key in the extension amount$ it wouldn't have to be this field, but just any field I can make a change to to fire the code basically ) So when I enter a new line before it moves to the next new line the script fires.
My problem is that I can never get the checkbox value when i'm at the line level. I am able to get it in sales order in this manner, but on the po screens no luck. Is there something special about the PO screens? how do I pass a header value to the line level in the PO screen?
Please see attached debug screen that shows me checking the box (and returning a Y value) at the header level, then adding a new row in the PO details and the value is blank.
thank you,
marc