<@UHP0BBX54> From the top of my head I think recip...
# suitescript
a
@ec From the top of my head I think recipient is a body field in the message record and not exactly a sublist field.
e
Thanks, @alien4u. But, I’m referring to this “list” here:
No ideas on the Message record? Odd that the “recipient” sublist exists, but I can’t get to it any which way i try…
b
its one of the weird things that dont match the ui
probably because records dont usually have a merge and send button
view an existing message to see which fields you have access to
alternatively use Record.getFields() if you think you can spot the field id you are looking for
e
yea, odd, i can’t spot the field! i entered some other recipients, and inspect all fields (using getFields and looping through the output of each one) and the other recipients aren’t there!
b
you will fail the task if you ignore both of us and keep trying to use a sublist that does not exist
e
?
i understand the sublist does not exist
however, how can i feed into the recipient or cc or bcc manually?
i mean programatically, overriding the UI
b
have you taken a list of the field ids available to you
e
i understand it is abnormal and not a real sublist we have access to or anything like in the UI. if it were, I would be able to setSublistValues
b
or have you taken a look at a message record in the ui to see fields that are available to you
e
i’ve taken ALL fields using getFields on the REC and spit them out - none include these email addresses.
b
what fields do you see
e
[“hasattachment”,“recipientemail”,“_button”,“nsapiFC”,“otherrecipientslistflags”,“subject”,“mediaitemloaded”,“wfVF”,“externalid”,“_eml_nkey_“,”type”,“emailpreference”,“nsapiRC”,“customwhence”,“compressattachments”,“nsapiVF”,“mediaitemflags”,“nsapiVD”,“contact”,“record”,“nsbrowserenv”,“id”,“otherrecipientslistlabels”,“nsapiVL”,“nsapiVI”,“otherrecipientslistfieldsets”,“wfPS”,“author”,“entryformquerystring”,“mediaitemvalid”,“mergefieldsmessages”,“submitted”,“entitytype”,“_multibtnstate_“,”compose”,“mediaitemparents”,“otherrecipientslistparents”,“recipients”,“letter”,“includetransaction”,“recipienttype”,“selectedtab”,“wfPI”,“preview”,“template”,“htmlmessage”,“submitter”,“wfinstances”,“activity”,“nsapiLI”,“messagedate”,“requestreadreceipt”,“lettertype”,“nsapiPS”,“nsapiCT”,“sys_id”,“mediaitemtypes”,“editsource”,“templatetype”,“recordtype”,“nsapiPI”,“mediaitemlabels”,“wfSR”,“nsapiLC”,“mediaitemorigtypes”,“nsapiPD”,“mergetypesmessages”,“nsapiSR”,“whence”,“lastmodifieddate”,“_csrf”,“baseid”,“l”,“mediaitemfieldsets”,“message”,“otherrecipientslistvalid”,“formdisplayview”,“otherrecipientslisttypes”,“recipient”,“time”,“wfFC”,“updatetemplate”,“entity”,“otherrecipientslistorigtypes”,“transaction”]
i noticed the otherrecipientslist but again, REC.getSublists only returns mediaitem and like you said, you can’t write to a sublist that NS doesn’t think exists!
cc, bcc are not in the list of fields - odd as well, as they appear in the record browser
this “sublist” in the UI allows you to select the entry as a recipient, cc or bcc. However, when i read the “recipient” in a beforeSubmit routine, it returns the ID or the entity and not the combined email address (which i would expect it to, for example, when i look at the record in UI after saving it shows in that field)
this is ODD
b
what script are you doing
thats not the fields you should get when you try to create a message
e
My goal: to pull from a custom list of contacts/emails associated with the transaction (or entity) and write to the recipients before load or on save, possibly
oh, that script was a beforeSubmit in UE
goodpoint, here: [“preview”,“mergetypesmessages”,“whence”,“author”,“subject”,“entryformquerystring”,“_csrf”,“_eml_nkey_“,”requestreadreceipt”,“l”,“type”,“emailpreference”,“nsapiCT”,“sys_id”,“compressattachments”,“entitytype”,“editsource”,“templatetype”,“recipient”,“includetransaction”,“recipienttype”,“updatetemplate”,“entity”,“transaction”]
that’s available beforeLoad
b
the record that you get when you try to create a message in suitescript is different that the record used by the ui
e
so, is there any way for me to manipulate the UI for the user opening the form?
b
if you are trying to do a beforeLoad from the ui, you will be working with the ui record
e
right, but do i have access to that list? i need to populate those email addresses here
b
log the fields and sublists in the beforeLoad
e
fields are above - and woohoo look at this! [“otherrecipientslist”,“mediaitem”]
ok, thanks @battk i can run with this perhaps
i was in the wrong contexts i guess? tried this client side too, but that sublist wasn’t avialable to the currentRecord either. only beforeLoad… sorry, thanks for the help! 😬
b
its also available beforeSubmit, before thats where netsuite converts it from the record used in the ui to the one used in suitescript
e
well, getSublists doesn’t return that - only mediaitem
(in befreSubmit)
b
do your logging in beforeSubmit with that sublist filled in with a value
you still wont get your sublists, but you will see what you have to do to the body level fields to match what netsuite does to convert between the 2 message representations
e
i think i just need to write to the sublist beforeLoad, then let the user make adjustments and let the record take itself from there - so we’re good! u the best, as usual
you deserve a trophy
1 more thing: there are checkboxes on that sublist (beforeLoad, otherrecipientslist), but getSublistFields doesn’t return anything. i figured out the cc and bcc, but the “to” is something else that I cannot figure out its script id
got it, it’s toRecipients (capital r, camel case, wow)
thanks, we’re good now
thank you both for your tremendous help @battk and @alien4u