daily pastebin goal
12%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. List<User> userList = new List<User>();
  2.     userList = [SELECT Id from User WHERE IsActive = true AND firstname = 'student'];
  3.  
  4.     for(User u : userList)
  5.             {
  6.                   System.setPassword(u.Id, 'newpassword');
  7.                   System.debug('DONE: ' + u.Id);
  8.             }
  9.    
  10. User u = new User(
  11.  ProfileId = [SELECT Id FROM Profile WHERE Name = 'Admin'].Id,
  12.  firstname = 'student',
  13.  Email = 'test@test.com',
  14.  Username = 'test@test.com' + System.currentTimeMillis(),
  15.  CompanyName = 'TEST',
  16.  Title = 'title',
  17.  Alias = 'alias',
  18.  TimeZoneSidKey = 'America/Los_Angeles',
  19.  EmailEncodingKey = 'UTF-8',
  20.  LanguageLocaleKey = 'en_US',
  21.  LocaleSidKey = 'en_US',
  22.  UserRoleId = r.Id
  23. );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top