Skip to content

Instantly share code, notes, and snippets.

@mchang-r7
Created January 5, 2018 14:23
Show Gist options
  • Save mchang-r7/7d6181284a2f8db5e9f0db5411b164f4 to your computer and use it in GitHub Desktop.
Save mchang-r7/7d6181284a2f8db5e9f0db5411b164f4 to your computer and use it in GitHub Desktop.
Revoke profile permissions in Salesforce Classic
var inputs = document.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i++) {
var input = inputs[i];
// Clear user permissions
if (input.id.startsWith('userPerm___')) {
if (input.checked) {
input.click();
}
}
// Clear CRUD permissions
if (input.id.startsWith('crud')) {
if (input.checked) {
input.click();
}
}
}
var selects = document.getElementsByTagName('select');
for (var i = 0; i < selects.length; i++) {
var select = selects[i];
// Hide all tabs
if (select.id.startsWith('tab___')) {
select.value = "0"; // Tab Hidden
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment