Mass customizing Salesforce
With 400 users across 20-odd countries, I am always looking for ways to make them more productive and efficient.
While much can be done at the role, profiles, and permission set level, at times the customization needs to be at the user level, and cant be generalized to a higher level of abstraction. Pulling this off without adding huge administrative overhead is possible! Read on…
We use an object that hangs off opportunities to allocate the total amount by program and location. Salesforce is not the system of record, but this object is key to dividing our pipeline across various programs and countries, and therefore these “funding links” are used by each and every country, and most people end up using the same set of codes most of the time.
So I wanted to allow each user to have a default set of codes, so that they can quickly create a record using their own personal default values. This is easy enough to do with a URL button hack: create a text field to store the value you want to pre-populate, and then reference that field in a custom “new” button. NOTE - URL HACKS ARE OFFICIALLY UNSUPPORTED BY SALESFORCE. PROCEED AT YOUR OWN RISK. THIS COULD BREAK AT ANY TIME. Publisher actions are the new and officially supported way of doing this, but I’m not sure if you can pull off what I have done w/ the custom button.
I’ll pull in some more details on how the custom button is built in a separate post. There are two places you could store the text field to store the default value – as a custom field on the user object, or in a custom setting. Using a custom setting feels proper, vs cluttering up the user object with a bunch of fields, but I went w/ custom fields on the user object, for a few reasons
- It is slightly simpler, and this was a pilot 2.Admins had to set the values of the codes for individual users, and its a bit faster to do so on the user object vs finding / creating the custom setting.
- I knew that eventually I wanted to build some code to allow users to set their preferred values themselves, and I felt like I could pull it off using custom fields on the user object and a bit of luck
Allowing users to customize their own default values is tricky, as they would normally need admin privileges to modify a field on the user record. However, controllers on a visualforce page can run in system mode, granting the running user this power, within the constraints of the fields and values you put on the page. So with a small amount of visualforce, I could create a page that would allow users to customize these values themselves. Safe Harbor - I am not a coder. Its distinctly possible that doing this is a bad idea but to the best of my knowledge it is perfectly fine.
Conveniently, chatter subtab apps were just about to be released as I was working on this, so I was about to be given the perfect place to display the customization page for users.
Will add posts about creating the button, the visualforce page, and the controller. Test classes shall be included!
Next post: the finished product