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
- Navigate to Customization > Workflow > Workflows > New
- 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
- Event Definition:
- On Create: Enter Checkmark
- On View or Update: Enter Checkmark
- Double click State
- Bottom right corner: Click New Action
- Click Set Field Value
- Basic Information:
- Trigger On: Select Before Record Load
- Parameters:
- Field: Select Expense Report Currency
- From Field: Enter Checkmark
- Record (Join Field): Select Entity (Employee)
- Field: Select Default Currency
- Click Save