Having an odd issue. Basically - we have Opportuni...
# suitescript
d
Having an odd issue. Basically - we have Opportunity records that are created with no line items which we are trying to update later via user event. We are getting the following SS1.0 error when attempting to edit the opp and insert the appropriate line: SSS_INVALID_SUBLIST_OPERATION: You have attempted an invalid sublist or line item operation. You are either trying to cannot access a field on a non-existent line or you are trying to add or remove lines from a static sublist. Code is very simple... User Event BeforeSubmit along the lines of: var newRecord = nlapiGetNewRecord(); newRecord.selectNewLineItem('item'); newRecord.setCurrentLineItemValue('item', 'price', '1'); newRecord.commitLineItem('item');
n
Probably comes down to the order you are setting columns. I would "guess" you cannot set the price before setting the item and so there's no valid line to commit. Unless you're not showing the full code and have set the item but in any event it's still likely to be the order you're setting columns. I would try replicating what you are doing in the code exactly via the UI and see if it breaks in the same way.