PiRemovalTask.save()
Method Description |
Saves 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 this method. |
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 |
---|---|---|
|
Record Type cannot be empty. |
The record type is not set. |
|
Record Type ‘type’ was not found. |
Record type does not exist. |
|
Record ID ‘ID’ was not found. |
One of the record IDs does not exist. |
|
Field ID ‘ID’ was not found. |
One of the field IDs does not exist. |
|
Workflow ID ‘ID’ was not found. |
One of the workflow IDs does not exist. |
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