Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
"nlapiSelectLineItem" is not defined"
Hi,
I have a saved search that I want to remove a specific category from all of the items in that saved search.
the script will check each item, If that category exist, then It will remove it and check the next item.
In my script I get the saved search result, then I load each items.
And check each category as the following code:
function remove_cat() { var searchresults=nlapiSearchRecord('item',<em>Saved-Search-Id</em>, null, null ); for(var i=0; i&lt;searchresults.length; i++) { var item = nlapiLoadRecord(searchresults<em>.getRecordType(), searchresults[i].getId()); for (var j=1; j &lt;= item.getLineItemCount('sitecategory'); j++) { if (item.getLineItemValue('sitecategory','category',j) == '[I]Category-Id</em>') { nlapiSelectLineItem('sitecategory',j); nlapiRemoveLineItem('sitecategory',j); nlapiSubmitRecord(item,true,true); break; } } } } 0