Thursday, November 19, 2015

How I Give Myself an 'Admin Out' in Validation Rules

I've found myself stuck a few times when I've created a validation rule in Salesforce but needed to update records that would trigger my rule criteria.

Example: I don't want to allow users to update a specific field after it's been populated upon record creation. But, occasionally as the system admin, I may need to update that field when a user makes a mistake.

In the past, I'd edit the validation rule that was preventing me from saving a change and deactivate it. But when you have multiple rules that you're 'breaking', this becomes rather cumbersome.

So, I've started adding an 'admin out' to my rules. There are several ways to do this (by profile id, user id, etc), but here's what's working for me:

I add in a criteria to not allow the change for anyone except a system admin, as defined by the profile name.

This has been working well for me.

Word of warning: I don't recommend doing this for all rules, especially those that prevent changes that could cause errors in reporting or data consistency. Be selective if you choose to allow yourself an 'admin out.'

Do you have an alternative method that works for you? Let me know in the post comments or share it with me on twitter - @rathergeeky.

No comments:

Post a Comment