Posted on Jul 07, 2015

This is a small, handy little javascript that will check all the checkboxes on the Field Visibility screen for a user profile.  Should work in the javascript console of all modern browsers.

var x = document.querySelectorAll(".displayedCol input"); for (var i = 0; i < x.length; i++) { x[i].checked="checked"; }

Sometimes while setting up objects and profiles for a project, you might do things out of order, or create objects using the Schema Builder or the Meta API, neither of which lets you set field permissions for user profiles.  Then you find yourself needing to go to each user profile, go to the field-level visibility settings of each object you created, and check all those boxes so the fields will be visible to the new profile.  The above javascript will check all the boxes for you; it's basically a "select all" for the Visibility column.

You can modify the querySelectorAll to use .readonlyCol input if you need check all the read-only checkboxes.

Something I've been meaning to do is compile together some UI tweaks and productivity aids for the Salesforce UI, implement them as bookmarklets or a user script or browser plugin.  Just a few things I'd like to tweak in order to make repetitive tasks easier or make up for short comings in the UI.  One day...