Does anyone have an example of using beforeLineInstanceId when inserting a line to a record in NetSuite? There’s no documentation on the usage.
g
Greg
08/19/2022, 7:19 PM
I love how the documentation on this says it is required for insertLine but then the example provided shows its not even used
Greg
08/19/2022, 7:21 PM
Im kinda just guessing here but you would probably want to loop through the lines in a list and collect the line "id"
var lineID = objRec.getSublistValue({
sublistId: 'item',
fieldId: 'id',
line: idx
})
then you could later on use var lineID with beforeLineInstanceId.
I have not tried it tho .. hope that helps!
j
jen
08/19/2022, 7:30 PM
it’s expecting it’s a string which is…weird
b
battk
08/19/2022, 9:01 PM
usually not practical to use
battk
08/19/2022, 9:03 PM
every time you load a record, each sublist line get assigned an instance id in its _id column
👍 1
battk
08/19/2022, 9:03 PM
it should be a uuid that looks like "07f85fb6-769a-4a7b-b179-a6f83ee9454a"
battk
08/19/2022, 9:05 PM
its impractical to use since you have no way of knowing what value is in the id without gettings its value, which requires knowing which line it is on
battk
08/19/2022, 9:05 PM
there are niche cases where you dont want to bother finding the line after inserting or removing other lines