Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Id profId = [SELECT Id FROM Profile WHERE Name = 'Community Knowledge User' LIMIT 1].Id;
- Account a = new Account(Name = 'Test5');
- insert a;
- Contact c = new Contact(AccountId = a.Id,
- FirstName = 'Morgan',
- LastName = 'Ma',
- Email = 'testusr5@test.ourwebsite.com',
- Title__c = 'Administrator');
- insert c;
- User u = new User(ContactId = c.Id,
- Alias = 'MSstA5',
- FirstName = c.FirstName,
- LastName = c.LastName,
- Email = c.Email,
- Username = c.Email,
- ProfileId = profId,
- EmailEncodingKey = 'ISO-8859-1',
- LanguageLocaleKey = 'en_US',
- LocaleSidKey = 'en_US',
- TimeZoneSidKey = 'America/New_York');
- insert u;
- System.setPassword(u.Id, 'Welcome1*');
Add Comment
Please, Sign In to add comment