In beforeSubmit , can i add add new line in sublis...
# suitescript
d
In beforeSubmit , can i add add new line in sublist ? I want to add customer's salesteam using beforeSubmit
Copy code
newRecord.selectNewLine({ sublistId: 'salesteam' });
                    newRecord.setCurrentSublistValue({
                        sublistId: 'salesteam',
                        fieldId: employee,
                        value: 1
                    });
                    newRecord.commitLine({
                        sublistId: 'salesteam'
                    })
I got this error
TypeError: newRecord.selectNewLine is not a function
b
the newRecord during beforeSubmit is not in dynamic mode
d
oo ic
ok, noted @battk
so if there are 1 line in the sublist, then i want to add a newline, i should do record.setSublistValue({ line : thenextline}) ?
n
the fun thing is "thenextline" is actually the line count since it's zero indexed 😉
d
ok thanks @NElliott