Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
workflow action script
I would like to create a custom field called Email on the customer form and have it auto fill with the customer email address with the "Primary contact" role. I am new to writing scripts so I tried applying the below but it did not work:
My primary role in NetSuite has Internal ID of -14. So I did the below:
function getContactEmail() {
var numItem = nlapiGetLineItemCount('contactroles');
for (var i=1; i<=numItem; i++)
{
var contact_rec = nlapiGetLineItemValue('contactroles', 'contact', i); // get all the contact name of the contacts of the customer
var contactEmailAddress = nlapiGetLineItemValue('contactroles','email', i); // get the e-mail address of the contact