function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sau_2010sau_2010 

How to create customer portal user if Contact is already exist .

Hi,

        i want to  create customer portal user when contact is already exist in org. the problem is duplicate contact id generated if i am using site.createportaluser() method. Please suggest me about this problem.  

 

Ispita_NavatarIspita_Navatar

You can have a trigger on the contact objec t which check for duplicates, and in case duplicate are fould an error can be raised and the user adequately alerted.

LinvioIncLinvioInc

I think the question was more about how to attach the existing Contact to the new user record if it already exists when the portal user is registering - throwing an error wouldn't allow the user to complete the registration.

 

We've tried setting the ContactId field on the new User record, but SF appears to ignore it and creates another Contact.  

 

Has anyone has success in attaching exsting Contacts during new user registration?