What do you guys generally do to bulk delete out c...
# suitescript
c
What do you guys generally do to bulk delete out custom records? Particularly when we have a large amount that need deleted.
m
I usually use a mass update script. Deploy it on the record to be deleted, then use the native Mass Update feature to select the record to be deleted and let the script handle it. Something like this:
Copy code
/**
 * @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 };
});
a
If you don't need to keep any record for that custom record: • Import the custom record definition into a SDF project. • Delete the record definition(that deletes all records). • Import the custom record definition from your SDF project.
That is by far the fastest way to delete custom records... ^^^
c
Will give the mass update script a try. Thanks.
Problem with deleting the record definition is we have some records we want to keep.
j
I do it the lazy way and just run a loop in the console….terrible I know. You start getting Script Execution Limit Exceeded messages but it still keeps deleting the records even after that.
👀 1
🙌 1
c
Lol yeah I’ve done that when it’s a few hundred but I need to delete like 25k