Trying to automatically set the SUBSIDIARY sublist...
# suitescript
b
Trying to automatically set the SUBSIDIARY sublist on the CUSTOMER record via a USEREVENT in 2.0
d
I'm not familiar with this sublist on the customer record but know the one on the vendor record and that one is set like a regular sublist. Is that possibly what you need to do?
b
Thanks @Dani for the insight.
SuiteAnswers recommends to set the SUBSIDIARY sublist on the CUSTOMER record by creating a new instance of the CUSTOMERSUBSIDIARYRELATIONSHIP record.
But that doesn't seem to work for me 😕
That's the code I put in chat.
But this works:
recObjLoaded.selectNewLine({sublistId: 'submachine'}); recObjLoaded.setCurrentSublistValue({ sublistId: 'submachine', fieldId: 'subsidiary', value: subsidiariesArray[x] }); recObjLoaded.commitLine({ sublistId: 'submachine' });
just setting it like a regular sublist
So good insight! 🙂
d
Gotcha, good to know and glad you figured it out!
b
Thx @Dani