Tuesday, October 12, 2010

Locking Salesforce records after they are audited

At first, this requirement seemed like it would be hard, but after researching the discussion board a little on Developerforce, I found that others had this same requirement and there was a logical solution to do this. I learned about page layouts and record types and how to control what the end user can see. I also learned to change a particular group of users view whenever a field is updated through workflow rules.

Requirement:
When a job record has been audited, the record needs to be locked.

Solution:
I created a new page layout and record type called "Locked" where all the fields would be read-only. Then, I created a workflow rule that would update the record type to Locked whenever the "Audited" check box was checked on the Job record.