I have a button that populates the email field in ...
# suitescript
p
I have a button that populates the email field in a message. That works fine but now I need to add an additional recipient. I am able to do this using 1.0 script but not 2.0. Any idea what I am missing on the 2.0? 1.0 Script
Copy code
nlapiSelectNewLineItem('otherrecipientslist');
nlapiSetCurrentLineItemValue('otherrecipientslist', 'email', '<mailto:example@mail.com|example@mail.com>');
nlapiSetCurrentLineItemValue('otherrecipientslist', 'cc', 'T');
nlapiCommitLineItem('otherrecipientslist');
2.0 Script
Copy code
var rec = currentRecord.get();
            rec.setValue({
                fieldId: 'recipientemail',
                value: '<mailto:example1@mail.com|example1@mail.com>'
            })
            rec.selectNewLine({
                sublistId: 'otherrecipientslist'
            })
            rec.setValue({
                sublistId: 'otherrecipientslist',
                fieldId: 'email',
                value: '<mailto:example@mail.com|example@mail.com>'
            })
            rec.setValue({
                sublistId: 'otherrecipientslist',
                fieldId: 'cc',
                value: 'T'
            })
            // Commmit The Item
            rec.commitLine({
                "sublistId": "otherrecipientslist"
            });
j
value for the CC might have to be
true
and not
'T'
b
the ss2 equivalent to nlapiSetCurrentLineItemValue is not setValue
j
oh yah that too
rec.setCurrentLineItemValue()
not
rec.setValue()
p
got it. thanks.