CurrentRecord.moveLine(options)
Method Description |
Moves one line of the sublist to another location. The sublist machine must allow moving lines, for example: The sublist must contain the When using this method, the order of the other lines is preserved. |
Returns |
|
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Sibling Object Members |
|
Since |
2020.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required |
The internal ID of the sublist. This value is displayed in the Records Browser. For more information, see Working with the SuiteScript Records Browser. |
2020.2 |
|
number |
required |
The line number to move from. Note that line indexing begins at 0 with SuiteScript 2.x. |
2020.2 |
|
number |
required |
The line number to move to. Note that line indexing begins at 0 with SuiteScript 2.x. |
2020.2 |
Errors
Error Code |
Thrown If |
---|---|
|
A required argument is invalid or the sublist is not editable. |
|
A required argument is missing or undefined. |
|
You are trying to move other than the current line. |
|
Moving of lines is not supported. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/currentRecord Module Script Samples.
// Add additional code.
...
r.moveLine(sublistId, 2, 0);
logMessage('After moveLine(sublistId, 2, 0)');
logState(r);
r.moveLine({
sublistId: sublistId,
from: 0,
to: 1
});
logMessage('After moveLine({sublistId:sublistId, from:0, to:1})');
logState(r)
...
// Add additional code.