Role Specific Drop Downs in SugarCRM

Today I ran in to a scenario where I needed the status field for projects to hide a value for everyone except two specific roles. I did some googling and found a post which seemed to theoretically accomplish what I was looking for. However, in practice it didn’t. That said, I won’t be covering what didn’t work as nobody really cares.

Now down to business. The first thing we need to do is edit the vardefs of the drop down to use a custom function that will handle the logic of determining if the specified value is available for selection.

Next, create the file and function to handle the logic.

Finally, run Quick Repair and Rebuild. The drop down is now hiding the “Pending Input” option for everyone except users in the Developer and Marketing roles.

This entry was posted in Uncategorized. Bookmark the permalink.

3 thoughts on “Role Specific Drop Downs in SugarCRM

  1. Hey Sean, great idea. What if you ONLY wanted the particular fields to be ‘unset’ in Edit view? I’ve found if you implement the above code, that the values you unset are no longer visible in Detail view as well as Edit view..

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Current day month ye@r *