Aaron McCausland
04/08/2025, 7:47 PMCeligo AI
04/08/2025, 7:47 PMAI generated answer (using internal Slack threads):To delete old custom record instances using Mass Update, you can use a Mass Update script. Here's a step-by-step guide: 1. Write a Mass Update script. This script will be used to delete the records. Here's a sample script:
javascript
/**
* @NApiVersion 2.1
* @NScriptType MassUpdateScript
* @NModuleScope Public
*/
define(['N/log', 'N/record'], function(log, record) {
function each(params) {
const { type, id } = params;
record.delete({ type, id });
}
return { each };
});
This script uses the N/record
module to delete each record. The each
function is called for each record that matches the criteria of the Mass Update.
2. Deploy the script on the record to be deleted. This can be done in the NetSuite UI by navigating to Customization > Scripting > Scripts > New, and selecting the script file you created.
3. Use the native Mass Update feature to select the records to be deleted. This can be done by navigating to Lists > Mass Update > Mass Updates. Then, select the type of records you want to delete, and set the criteria for the records to be deleted.
4. Run the Mass Update. The script will be executed for each record that matches the criteria, deleting the records.
Please note that this method should be used with caution, as deleted records cannot be recovered. It's recommended to preview the records that will be deleted before running the Mass Update.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
04/08/2025, 7:48 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83803159
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835454464
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83201623
Celigo AI
04/08/2025, 7:48 PM