Created
April 23, 2015 06:31
-
-
Save hasanthaera/6499299886c540234873 to your computer and use it in GitHub Desktop.
Salesforce - Mass Update saleforce1 mobile field with APEX
This file contains 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
/** | |
* Author: Hasantha Liyanage | |
* Created: 2014-12-15 | |
* Summary: This will update the UserPreferencesHideS1BrowserUI field and make the Salesforce1 User | |
* field on User object false | |
**/ | |
// get the users who does not have salesforce1 mobile feature enabled | |
List<User> users = [ | |
SELECT | |
Id, | |
IsActive, | |
UserPreferencesHideS1BrowserUI | |
FROM User | |
WHERE | |
IsActive = true | |
AND | |
UserPreferencesHideS1BrowserUI = false | |
]; | |
// make the users salesforce 1 mobile fetaure disabled individually | |
for(User user : users){ | |
user.UserPreferencesHideS1BrowserUI = true; | |
} | |
update users; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment