Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {"Contact.Account", "001230942830"},
- {"Contact.Email", "theEmail@gmail.com"},
- {"Contact.FirstName", "theFirstName"},
- {"Contact.LastName", "theLastName"},
- {"User.Email", "theEmail@gmail.com"},
- {"User.UserName", "theEmail@gmail.com"},
- {"User.FirstName", "theFirstName"},
- {"User.LastName", "theLastName"},
- {"User.Alias", "theAlias"},
- {"User.ProfileId", _profileID}
- /*
- * If you are updating Contact or Account object fields, you cannot update the following User fields at the same time.
- * If your identity provider sends these User fields as attributes along with Contact
- * or Account fields, you must modify the logic in this class to update either these
- * User fields or the Contact and Account fields.
- */
- if(attributes.containsKey('User.IsActive')) {
- String IsActiveVal = attributes.get('User.IsActive');
- u.IsActive = '1'.equals(IsActiveVal) || Boolean.valueOf(IsActiveVal);
- }
- if(attributes.containsKey('User.ForecastEnabled')) {
- String ForecastEnabledVal = attributes.get('User.ForecastEnabled');
- u.ForecastEnabled = '1'.equals(ForecastEnabledVal) || Boolean.valueOf(ForecastEnabledVal);
- }
- if(attributes.containsKey('User.ProfileId')) {
- String profileId = attributes.get('User.ProfileId');
- Profile p = [SELECT Id FROM Profile WHERE Id=:profileId];
- u.ProfileId = p.Id;
- }
- if(attributes.containsKey('User.UserRoleId')) {
- String userRole = attributes.get('User.UserRoleId');
- UserRole r = [SELECT Id FROM UserRole WHERE Id=:userRole];
- u.UserRoleId = r.Id;
- }
Add Comment
Please, Sign In to add comment