Tip #490: Do not reuse the owner field

So you are creating an entity in Dynamics CRM and you need a user lookup field. Why not just re-label the owner field? Sure, it is not specifically a record owner, but we don’t really need that for this entity anyway, as we will never tie security to it, right?

Don’t do it! Chances are you will regret it down the road.

Never say never. You never know what will happen in the future. Your little custom entity may grow, or your CRM environment may grow to be used outside of just your group. When this happens, you may well want to have security limitations on the entity, and if the owner field is used for a non-security related user lookup, this will force you to do rework in the future.

Also, if you use the “owner” field for non security related user lookups, you make “assign” permission required to change that field. This may not sound like a big deal, but it can be. Two years from now, you decide to add a child entity with a parental relationship to your custom entity. You set security on this entity, as you don’t want other people changing the data in it. Now when users try to change the user lookup on the parent, they get a “permission denied” error because the user changing the user field on the parent entity does not have assign permission the child.

So if you need a user lookup field for a user role that is not a traditional record “owner,” take a few second and create a custom relationship

Leave a Reply

Your email address will not be published. Required fields are marked *