Scenario:
If the error “An unexpected SuiteScript error has occurred.” is encountered when saving a record that has a workflow running on it, check the workflow for any Send Email action.
When adding a Send Email action on a workflow, there should always be a condition to check for both sender’s and recipient’s email address availability.
Solution:
- Navigate to Customization > Workflow > Workflows
- Workflow: Click Edit
- Double-click the State that contains the Send Email action
- Click Send Email
- Condition:
- Use: Select Visual Builder
- Workflow Condition Builder:
- Record: Select the record selected under the Record (Join Field) for both the Sender and the Recipient
Note: When a Specific Sender or Recipient is set, the record type of the Sender or Recipient should be selected instead. - Field: Select E-mail
- Compare Type: Select not Empty
- Click Save
- Record: Select the record selected under the Record (Join Field) for both the Sender and the Recipient
- Click Save