Getting the following error when trying to set the...
# suitescript
n
Getting the following error when trying to set the help text on these form fields: Cannot find function setHelpText in object .
n
Use
Copy code
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.' })
  .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
Copy code
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 : '');
n
Ah much appreciated. Thanks
@ns_dev 👍