Scenario
Add a Formula on the Add Button action of a Workflow to consider the user’s subsidiary in showing the list of transactions on the bulk approval page (for example: Approve Bills page) and displaying the Approve button on transaction records. The standard subsidiary restrictions will not be followed because the bulk approval page generates the list based on the Custom Workflow’s actions on the Action field.
Solution
To make sure that the bulk approval page shows only transactions related to the subsidiary of the employee/user, try the following solutions:
- Use a custom view on the page:
- Using an Administrator role, create a Custom View and add the filter – Subsidiary is Mine
- Add a condition on the Add Button action of the Workflow to check the user’s subsidiary. On the Workflow State where the Add Button for Approve belongs to:
- Add a State Field
- On the Workflow, click State
- Upper right corner: Click the pencil icon
- Click Fields
- Click New Field
- Label: Enter Label
- Example: Record Subsidiary
- Type: Select Free-Form Text
- Store Value: Remove Checkmark
- Click Save
- Add a Set Field Value action
- Trigger On: Select Before Record Load
- Field: Select Record Subsidiary (State)
- Value: Select Formula
- Formula: {?subsidiary.id}
- Click the Add Button action for the Approve button
- Click the open icon beside the Condition Builder box to edit the condition
- Condition: {?<ID of the State Field created in Step 1>} = {?user.subsidiary}
- For example, if the ID of the State Field created in Step 1 is custwfstate1, the formula should look like – “{?custwfstate1} = {?user.subsidiary}”
- Click Save
- Click Save again
- Upper right corner: Click the pencil icon
- Place the Set Field Value action (Step 2.2) before the Add Button action for the Approve button