You need to sign in to do that
Don't have an account?

Enable portal user for existing contacts during sites self-registration
During the sites self-registration process, I have only come across the ability to create a portal user that creates both a contact and a user synchronously. I would like to be able to create a portal user using an existing contact. I tried setting the contact id on the user object before I called createPortalUser, but it still created a new contact. We are trying to eliminate the possibility of duplicate contacts.
Hi,
I have faced such situations in this case , we are associating the existing contactId to the newly created user, we written our custom registration controller. hope it is clear.
All Answers
Currently there isn't a way to do that.
For preventing duplicates, would it be possible to query for similar accounts before the user registers?
Hi,
As ryan said, i am just adding few lines to it.
You can write a controller where you can query for a contact, and if it exists then convert the contact in to a site user else create a contact and then convert the contact in to a site user.
We are doing this using a webservice call, i dont know whether you are using out of box site's self registration controller or something.
Thanks.
Yes, I am using the sites object to create the portal users and following the code from the out-of-the-box self-registration controller as an example. I am querying for an existing contact, but I don't see a way to convert that existing contact to a site user. The sites object just creates a duplicate contact. Can you tell me how you are converting a contact to a site user? Many thanks in advance :)
Hi,
We use webservice to do this. We have 4-5 separate methods, first to check for a contact, if not create the contact, then check for the user, if not create the user by associaing it with the respective contact. In the user insertion method, we have something like, newuser.ContactId = contact.Id; (contact.Id is being queried in the user creation method).
Thanks.
Hi,
I have faced such situations in this case , we are associating the existing contactId to the newly created user, we written our custom registration controller. hope it is clear.
Can u post the code in which you were able to enable new users under existing contact. It will help me alot...
As mentioned above any example code would be greatly appreciated. Thanks!
Can u post the code in which you were able to enable new users under existing contact. ASAP. It will be very very helpfull. As I don't do that level of SF work yet, so any help would be great.
Can u post the code in which you were able to enable new users under existing contact. ASAP. It will be very very helpfull. As I don't do that level of SF work yet, so any help would be great.