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.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
"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