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
Note:
Remove Personal Information Run permission is required to run a PI removal task. |
Returns |
void |
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
20 units |
Module |
|
Parent Object |
|
Sibling Object Members |
|
Since |
2019.2 |
Errors
Error Code |
Error Message |
Thrown If |
---|---|---|
UNEXPECTED_ERROR |
Cannot run unsaved PiRemoval job. |
The PI removal job is not saved. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/piremoval Module Script Sample.
// 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