HI WELCOME TO KANSIRIS

Locking Fields in a Business Process Flow

Leave a Comment

 Often times, a consultant will need to implement a business process in which the user should not be allowed to go back to a previous stage to change the field values.

I had a similar requirement recently. Being a functional consultant, I try my best to implement solutions using OOB features or through point and click customization and avoid JavaScript or custom code solutions. However, I could not find any OOB functionality to implement this client request. So naturally I hit the internet and the community forums to find out how this can be implemented. What I noticed was that most of the solutions used JavaScript or custom code. So I had to go back to the drawing board and come up with my own solution.

The solution I implemented involved creating the following:

  • A two options (yes/no) Custom field. I called it Lock
  • A workflow to set the Lock as yes
  • A workflow to check if the fields can be edited based on the Lock value.

A workflow to set the Lock as Yes:

 This workflow was implemented as an on-demand workflow and called on the stage exit of the BPF. This is the stage which once the user exists, I want to lock the fields for all previous stages.

No alt text provided for this image

The workflow itself is really simple. It just updates the value of Lock to Yes.

No alt text provided for this image

A workflow to check if the fields can be edited based on the Lock value:

This workflow was implemented as a real-time workflow. The trigger was for those fields which need to be locked and before the record is updated:

No alt text provided for this image

The workflow simply checks the value of Lock and throws an error if the Lock is set to Yes.

No alt text provided for this image

Conclusion:

As an added benefit, even if the user tries to edit the fields from the form, the workflow will not let this happen. A really simple point-and-click solution for a common scenario. I hope this article is helpful.

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.