A user wants to use a Lock Record action on their existing Workflow so that any other employees cannot edit a record not unless it uses an Administrator role (e.g Sales Order). However, Before Record Load triggers are not executed on Inline Edit. Hence, the Lock Record action in the Workflow is not being triggered when using the Inline Edit feature.
Editing the record via Inline editing edits the record directly and does not load the record into the browser, the lock will not be applied and thus allowing the user to edit the record.
Nutrex client want salespeople to edit Sales Orders using inline editing when order status is Pending approval. For all other order status salespeople are not able to edit via inline editing.
Solution
- Navigate to Customization > Workflow > Workflows
- Edit your existing workflow (e.g Lock Sales Order)
- Click State 1
- Bottom right corner: Click New Action
- Select Return User Error
- Basic Information:
- Trigger On: Select Before Record Submit
- Event Types: Select Direct List Edit
- Condition:
- Click Open button
- Field: Select User Role
- Compare Type: Select none of
- Selection: Select any custom role
- Field: Select Order status
- Compare Type: Select none of
- Selection: Select Pending approval
- Parameters:
- Text: Enter The record is locked!
- Click Save