Hi,
I'm new to NetSuite scripting and have a requirement that it causing me some grief! I was hoping someone here could point me in the right direction.
When an item group is entered on the order I need all the members of the group to have their price level set to the price level set on the item group (custom field).
My frist step was to try and identify when a group was entered, I found that the the recalc event seemed to fire on the 1st line (the group) only. It did also seem to fire on the line after the end group line as all the fields seemed to blank (item id, item type etc). I did manage to identify if a group had just been entered (but I'm not sure it's the best way as it checks for a blank item in the recalc event and then looks at the previous line to see if it is an end group line).
I then loop backwards through the lines to get the group item and get the price level I want. I now want to set all the lines between the group and the end group to this price level. I thought I had the code down but I get the an error that I can't work out the reason for.
The bit of code to set the price level in my reclac event is below:
var j; for (j = iGroupLine+1 ;j < iEndLine; j++) { nlapiSelectLineItem('item',j); nlapiCurrentLineItemValue('item','price',stGroupPriceList,true,true); nlapiCommitLineItem('item'); }when the line nlapiSelectLineItem('item',j); is executed I get the following error:'cannot create an option with null text'Anyone have any ideas as to what this error means or why it is being raised? I wondered if maybe the lines weren't complete when I was trying to run this as the line number seemed to be null.If anyone has better approach to handling my requirement then I would be very interested in that too!ThanksMatt