Create Lightweight Contactless External Identity Users (Generally Available)
Where: This change applies to all communities accessed through Lightning Experience and Salesforce Classic in Enterprise, Performance, Unlimited, and Developer editions.
Who: This feature applies to users with the External Identity license—users with the Identity for Customers and Partners product. It’s also available to Communities users when they want to downgrade to an External Identity license. Contact Salesforce Customer Support to enable this feature.
How: To create a contactless external identity user, create a user record using Apex, SOAP, or Bulk API.
User u = new User(); u.FirstName = 'Jane'; u.LastName = 'Doe'; u.Email = 'firstname.lastname@example.org'; u.Alias = 'jane'; u.Username = 'email@example.com'; u.CommunityNickname = 'Jane'; u.LocaleSidKey = 'en_US'; u.TimeZoneSidKey = 'GMT'; u.ProfileID = '00exx000000jvN4'; // Profile that's associated with the EI license u.LanguageLocaleKey = 'en_US'; u.EmailEncodingKey = 'UTF-8'; insert u;
To add a contact to the contactless external identity user, create a contact, and then associate the contact with the user.
Account a = [SELECT Id FROM Account WHERE Id = '001xx000003DIyf']; Contact c = new Contact(); c.FirstName = 'Sonia’; c.LastName = 'James'; c.AccountId = a.id; insert c; User u = [SELECT Id FROM User WHERE Id = ‘005xx000001TLlf’]; u.ContactId=c.id; update u;
Only users with an External Identity license can be contactless. So if you want to remove a contact from a user with a Communities license, you first downgrade the user to the External Identity license. Then you can remove the contact.