We have a situation whereby the invoice created tr...
# suitescript
d
We have a situation whereby the invoice created transaction sends an email when it's run via a csv processor. But when we created the invoice via our restlet/suitescript, and the
tobeemailed
boolean
value is set to
true
, no email is sent. Am I missing something obvious here? Is it permissions related or do I have to do something else explicitly in the code?
b
beyond checking for undelivered emails, i would double check that the email field is set
t
@Darren Are you testing the RESTlet in a sandbox? If so, that might be tripping you up.
d
yeah, this is in a sandbox
but it's fine with csv upload in sandbox
Email field seems to be set in the UI @battk
b
check in script
id also double check the email preferences to see where the emails should go
d
so you reckon setting the email preferences and email in the script as it runs?
b
d
if we set the email preferences for a customer as send emails - it works fine. but we only want it for invoice txs, so we can't set that to true all the time
the CSV processor doesnt seem to need this comms preference set
which is why I expected
tobeemailed
true to work out of the box
any thoughts?
b
normal behavior you should be seeing is that setting the tobeemailed field should add a message record to the message sublist on the transaction, with the recipient being the value(s) in the email field
netsuite might not actually send out an email depending on the account's email preferences, but you should at least have something in the message sublist
d
yeah, so we;ve got whitelisted 3 email addresses in the preferences for sandbox/RP. But the invoice shows an email address against the To Be Emailed section, but no messages in the message sublist.
b
might want to make sure there are no other scripts or workflows manipulating email fields
d
ok, thanks @battk i'll keep digging