Created
October 23, 2017 19:09
-
-
Save matthewpoer/1ad17a046bb64f322020ac96ffcfa809 to your computer and use it in GitHub Desktop.
SFDC Set History Tracking for all fields. Natively the UI only allows you to de-select all fields. This JS will invert the native function and select all of the fields on the screen. Note that SFDC only allows 20 fields to be tracked, so you may have to manually remove some before saving.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// copy the text out of the native function | |
var selectAll = selectNone.toString(); | |
// replace "checked=false" with "checked=true" | |
selectAll = selectAll.replace(/checked=false/g, 'checked=true'); | |
// rename the function | |
selectAll = selectAll.replace(/function selectNone/g, 'function selectAll'); | |
// the text var selectAll now contains a new function, so calling eval make it accessible | |
eval(selectAll); | |
selectAll(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment