Modules
Objects/Functions
SuiteScript 2.0
{PiRemovalTask}.run(){UNEXPECTED_ERROR: {Cannot run unsaved PiRemoval job.}})
N/piremoval Module
PiRemovalTask.run()
Method Description:
Runs the PI removal task.
All validation for the task (for example, ensuring that the specified record IDs are valid) occurs when the task is saved using PiRemovalTask.save(), not when the task is run using PiRemovalTask.run().
Returns:
void
Supported Script Types:
Server scripts
For more information, see SuiteScript 2.0 Script Types.
Governance:
20 units
Module:
N/piremoval Module
Parent Object:
piremoval.PiRemovalTask
Sibling Object Members:
PiRemovalTask Object Members
Since:
2019.2
Search NetSuite -
https://system.netsuite.com/app/help/helpcenter.nl?search=PiRemovalTask.run()
Example:
// Code Example 1
// Add additional code
//...
var myPiRemovalTask = piremoval.createTask({
recordType: 'customer',
recordIds: [11, 19],
fieldIds: ['comments', 'phone'],
workflowIds: [1],
historyOnly: false,
historyReplacement: 'removed_value'
});
myPiRemovalTask.save();
var myTaskId = myPiRemovalTask.id;
myPiRemovalTask.run();
//...
// Add additional code
//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_156174672468.html