Hi everyone, is there a quick way to delete all fi...
# general
j
Hi everyone, is there a quick way to delete all financial/inventory transactions in sandbox?
t
The quickest way without writing a pretty involved script is to create a mass update script. There's definitely a quicker way if you're pretty good with suitescript. If you're not, I can send you the code snippet that I wrote to delete transactions
This requires that you delete transactions in a specific order so you have to run the mass update script for each transaction type
j
Thanks @Tyson Eby, went without any scripting and just did it manually. Sad day
t
that's a bummer
here's the code just in case you ever need to do this again
Copy code
function delete_records(rec_type, rec_id)
{
  try {
	nlapiDeleteRecord(rec_type, rec_id); // Delete record
  } catch (err) {
    nlapiLogExecution('ERROR', rec_id);
  }
}
Just build the search for the mass update and include the record type and id. Be sure to set the criteria correctly if you're not trying to delete all transactions