Issue:
An issue was encountered where the Edit button was still visible to users, even though certain records were locked through workflow processes. Although users were unable to edit the transaction due to the lock, the presence of the Edit button created confusion and led to unnecessary attempts to make changes.
Here is a step-by-step guide to the solution:
Navigate to the workflow of the record that needs to be locked.
Select the “Lock Record” Option from “New Actions”.
Define the Condition: Set a condition to specify which user roles should be restricted. Under the condition settings, select “user role” and then choose “none of” followed by “administrator.” This condition ensures that the lock applies to all roles except administrators.
Configure the Trigger: Set the appropriate trigger to activate the lock. Under the trigger settings, select “Before record load.” This ensures that the lock is checked and enforced before the record is displayed to the user.
Select the Event Types: Finally, ensure that the event type is set to “view.” This guarantees that the lock is applied when the record is being viewed, thereby hiding the Edit button from non-administrative users.
Now, the Edit button will be only visible to administrators, preventing other users from attempting to edit locked records and improving the overall user experience.