+ Start a Discussion
adreameradreamer 

Customer Portal self-registration and Person Accounts

Hi All,

 

I am trying to get visitors of a site to self-register as members using the customer portal. This is something I have done a few times now, but in this case is not working.

 

The logic I during self registration is as follows:

 

- create a user, user

- create an account of type person account

- insert the account

- change the account owner to a system admin with a role assigned

- update the account

- get the accountId

- make the following call --> ID userId = Site.createPortalUser(u, accountId, password);

 

The above call return userId=null, so that the customer portal user is not created.

 

I have tried to do "manually"what  the Site.createPortalUser call does internally and it works. What I have done is as follows:

 

- create a user, user

- create an account of type person account

- insert the account

- change the account owner to a system admin with a role assigned

- update the account

- get the accountId

- get the PersonContactId (since this is a Person Account)

- assiign  user.ContactId = PersonContactId

- assing user.profileId = (Id of the customer portal user profile)

- insert user

 

This gets me a valid userId and the person account is created and enabled for the customer portal okay.

 

On that basis I have tried again the call to  Site.createPortalUser but instead of the accountId tried passing the PersonContactId (since it is a person account) and this did not work.

 

Any ideas would be very much appreciated.

 

Thanks in advance

 

Best Answer chosen by Admin (Salesforce Developers) 
BulentBulent

there is a limit on how many person accounts can be owned by to the same internal user. Person accounts roles are tied to the owners role. If you have too many of these when you change the owner there might be performance issues. 

Because of this limit it's not feasible to provide an automated self service registration for person accounts via sites (otherwise after every x number of registration you would need to pick a new owner etc..)

All Answers

adreameradreamer

Hi All,

 

I have realized that self-registration for person accounts it is not supported. According to the manual:

 

Self-RegistrationThe following apply to self-registration for sites:

  • Sites does not support the use of Person Accounts for self registration.

 

As I said in my previous post, I can create a customer portal user associated with a person account, and get a valid userId. The only issue would be that I cannot set his/her password.

 

Do we have to live with this ?

 

Thanks

BulentBulent

there is a limit on how many person accounts can be owned by to the same internal user. Person accounts roles are tied to the owners role. If you have too many of these when you change the owner there might be performance issues. 

Because of this limit it's not feasible to provide an automated self service registration for person accounts via sites (otherwise after every x number of registration you would need to pick a new owner etc..)

This was selected as the best answer
adreameradreamer

Many thanks Bulent.

 

This clears things out.

adreameradreamer

Bulent,

 

From the business process perspective it is quite important I use person accounts and have self-registration in sites. 

 

I understand that there is a limit to the number of person accounts a user can own. Can you give me the exact figure ?

 

The reason I am asking is because the following solution might work:

 

- I use self registration using account/contact instead of person accounts.

- I have a trigger that converts the account/contact into a person account.

 

If I know what's the limit on the number of person accounts a user can own, I can check how many are owned by one user and if it has reached the limit, use another user.

 

What do you think ?

 

Thanks

BulentBulent

the default limit value is 1,000. It can be increased based on request after a review process.

 

adreameradreamer
Thanks, this helps.
d3developerd3developer

Would be great to have the full source for the above.

marty_bgimarty_bgi

I understand this reponse, but as ISVs build B2C applications what is the best practice for self registration?  Eventually, I would like the self registration to tie into PayPalX. 

BulentBulent

self service registration support for person accounts is on our roadmap (safe harbor) for winter11 release (only authenticated website user and high volume portal user types will be supported).

 

Until then you can either create one account and create all the users as a contact under this account or go with b2b model (account and contact for each registration).

marty_bgimarty_bgi

Thanks for the quick reply...I'll try out the Account with multiple contacts route for now.

Nilesh BadrakiyaNilesh Badrakiya

Hi Bulent,

i am getting the same problem ,but in my case i m creating a bussiness account when doing registration.it doesn't give any exception but remain on same page. it is able to create a account and contact ,but don't able to create a user. Do you have any idea?

 

Regards,

Nilesh Badrakiya

 

sdbsdb

Bulent, can you tell me if this same restriction applies for individual accounts created by the Non-Profit Starter Pack? We are creating contacts, NPSP creates the individual account for the contact, then we set the individual account owner id to a user (always the same one) in the role hierarchy. This was all working fine, but a few days ago we started seeing this error more and more often. There could be over a 1000 portal users whose accounts are all owned by the same user.

jieves@kyrobros.comjieves@kyrobros.com
Bulent, I've recently hit this limit and an wondering where it is documented. Just looking for more info so I can be better prepared next time when creating solutions. Thanks!
Syed Subhan 9Syed Subhan 9
Hi All,
Can someone post the code in which you were able to enable 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.