How can I massively remove items from Commerce Categories?
Is there a way I can do a mass removal of items assigned to a commerce category?
If you can trying using suitescript in console of that commerce category in edit mode, maybe that can help.
Try using NetSuite’s suggestion:
(You at your own risk)
1. Create the saved search for the Items
- Navigate to List > Search > Saved Searches > New
- Select Items
- Make sure to populate Search Title and ID
- Under Criteria:
- Display Web Site = Yes
- And under Results put in:
- Display Web Site
- Commerce Category Name (So that you will see which category the item falls in to)
- Click Save
2. Download the saved search to be edited. (Make sure to have a copy of the downloaded file)
- Go to List > Search > Saved Searches
- Click on Export (CSV) on your newly created Saved Search for the Categories
- A pop-up should appear
- Click Save File then press OK
- Open the newly downloaded file
- Edit Display in Web Site to change the categories that you want to remove then set to “No“
3. Then import the CSV File to NetSuite
- Navigate to Setup > Import/Export > Import CSV Records
- Import Type = “Items”
- Record type = “Inventory Item”
- the Upload CSV file
- Click Next
- Select ADD OR UPDATE
- In the Field Mapping make sure all the fields are mapped correctly
- Put a Import Map Name
- Click Save
4. Perform a Cache Invalidation Request to refresh the website
- Navigate to Commerce > Content Management > Cache Invalidation Requests > New
- New Invalidation Requests
- Select the domain.
- Click Clear Cache for the whole domain(s)
- Click Submit
You can remove anything in NetSuite using the following code.
** This is a really sensitive code ***
————- CODE ————-
var type = ”; // Here a pre-build saved search id filtering only the records to be deleted.
var l = nlapiSearchRecord(type, null);
for(var i =0; i<l.length; i++){
try{
nlapiDeleteRecord(type, l[i].id);
console.log(‘Deleted ‘ + type, l[i].id);
}catch(e){console.log(‘ERROR ‘ + l[i].id, e);}
————- CODE ————-
good luck!
Thanks! this will come handy, but I don’t want to delete the items from NetSuite, I want to remove them from the Commerce Category they are assigned to.



