I'm currently investigating a scripting error that one of our users reported. The real quick summary is that on a new invoice, after a customer is selected, a post_sourcing script is run to go through and automatically check the apply box on certain line items in the Billable Time sublist based on some rules that are defined in the script.
However, when the script actually goes to set the field value, the following error is thrown:
An unexpected error occurred in a script running on this page.
postSourcing_FillInDefaultValue (postSourcing)
customscriptload_values_so
JS_EXCEPTION
TypeError Cannot read property 'checkvalid' of undefined.
I've been able to narrow the culprit down to a single line of code: nlapiSetCurrentLineItemValue('time', 'apply', 'T', true, true);I tried using nlapiSetLineItemValue instead (specifying the appropriate line to change) and it does not throw the error, but I am hesitant to use this method as I understand that it does not trigger the field change event, and judging from the way the code was originally written I have a feeling it is needed (unfortunately I do not have access to the person that originally wrote the code to ask and have not had time to dig deeper to find out for sure). I did quickly test however and changing the firefieldchanged parameter in the original code to false does not help.Does anyone have any ideas as to why this exception would be getting thrown? (and why using nlapiSetLineItemValue would work?)Thanks for the help!~ChrisPS: Sorry if this is in the wrong place. Probably should have posted it in the SuiteScript / Custom Code board.