Nick
09/23/2019, 12:59 PMns_dev
09/23/2019, 1:19 PMemailsender = form.addField({
'id': 'custpage_fromemail_employee',
'label': 'From Email Sender',
'source': record.Type.EMPLOYEE,
'type': serverWidget.FieldType.SELECT,
'container':'custpage_emailgroup'
})
.setHelpText({ help: 'Select the user to be the author of email messages from the customer portal.' })
.defaultValue = (configSettings.fromemail ? configSettings.fromemail : '')
instead of what you have used in all of your fields and it should work. Since deafultValue property does not returns anything, so your var used to store reference of Ns fields is undefined and hence the error.
Note: If you want the reference of Email Sender field for later, change the code to
emailsender = form.addField({
'id': 'custpage_fromemail_employee',
'label': 'From Email Sender',
'source': record.Type.EMPLOYEE,
'type': serverWidget.FieldType.SELECT,
'container':'custpage_emailgroup'
})
.setHelpText({ help: 'Select the user to be the author of email messages from the customer portal.' });
emailsender.defaultValue = (configSettings.fromemail ? configSettings.fromemail : '');Nick
09/23/2019, 1:31 PMNick
09/23/2019, 1:31 PM