Resolve Error: “Unexpected Error” Caused by a Workflow Setting the Employee Field on Before Record Load Trigger

Scenario:

Upon saving Expense Reports, the system throws an unexpected error. An existing Workflow with a server-side Set Field Value Action that triggers on Before Record Load is to set the Employee field upon creation of Expense Reports then the Currency field is auto-populated via Sourcing based on the employee.

Server-side triggers does not respect Form Events such as Sourcing, which are client-side triggers. With the current setup of the Workflow, auto-populating the Employee field will not trigger the Currency field to auto-populate, thus causing the error. To resolve the error, a separate workflow should be created.

Solution:

1.Edit the Workflow that sets the default Employee field

  • Navigate to Customization > Workflow > Workflows
  • Preferred Workflow: Click Edit
  • Double click State
  • Preferred Set Field Value action: Click Set Field Value
  • Basic Information:
    • Trigger On: Select Before User Edit
  • Click Save

2. Create a Workflow that will source the Employee’s Default Currency

  1. Navigate to Customization > Workflow > Workflows > New
  2. Basic Information: 
    • Name: Enter Set Company Field Test 
    • Record Type: SelectTransaction
    • Sub-type: Select Expense Report
    • Execute as Admin: Enter Checkmark 
    • Released Status: Select Released 
    • Keep Instance and History: Select Always 
    • Enable Logging: Enter Checkmark
  3. Event Definition: 
    • On Create: Enter Checkmark 
    • On View or Update: Enter Checkmark
  4. Double click State
  5. Bottom right corner: Click New Action
  6. Click Set Field Value
  7. Basic Information:
    • Trigger On: Select Before Record Load
  8. Parameters:
    • Field: Select Expense Report Currency
    • From Field: Enter Checkmark
      • Record (Join Field): Select Entity (Employee)
      • Field: Select Default Currency
  9. Click Save

Leave a comment

Your email address will not be published. Required fields are marked *