VaranAwesomenow
Mega Sage

Generally once clone takes place from production to a non production instance. Export history will contain records in exporting state which were part of the clone, and they will remain in that state as those exports were not triggered from the non-prod instance. Hence as part of post clone these need to be cleaned up, below code snippet does that work.

Also one interesting observation is.. in export history table there is not UI action at list level to cancel an export, while the same is available at form level.

var grExportSetRun = new GlideRecord('sys_export_set_run');
var enQuery = 'state=exporting';
grExportSetRun.addEncodedQuery(enQuery);
grExportSetRun.query();
while(grExportSetRun.next()) {
var exportSetRun = new SNC.ExportSetRun();
exportSetRun.requestCancel(grExportSetRun.sys_id);
}

Version history
Last update:
‎09-13-2022 02:30 AM
Updated by: