You need to sign in to do that
Don't have an account?
Ajay Dubey
How to enable customer user for existing contact using apex?
For the community self registration page if the user enters the detail, I want to check if the contact already exist on the basis of email entered by user. If it does, I want to create user for that existing contact. How can achieve this?
Prepare the User record data using the Contact details. Then call the Site.createPortalUser(user, accountId, password, sendEmailConfirmation) method to create the user for you.
Thanks
Anupama
All Answers
Prepare the User record data using the Contact details. Then call the Site.createPortalUser(user, accountId, password, sendEmailConfirmation) method to create the user for you.
Thanks
Anupama
Thanks for the solution, it is working now.I was trying to insert user using insert DML instead of Site.createPortalUser(user, accountId, password, sendEmailConfirmation).
Thanks
Ajay
Hi Ajay,
Can anyone please post the code in which you were able to enable or create new users under existing contact in the community. ASAP. It will be very very helpfull. As I don't do that level of SF work yet, so any help would be great.
Waiting for the reply. Thanks in Advance.
I am providing you the complete class, There might be some irrelevent logic in the code for you.