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
sfdcchampionssfdcchampions 

Let existing portal user create another portal user after login

Hi folks,

 

I have a requirement where i have to let the portal user add more members( customer portal users) to his existing account.

 

I am unable to do that using Site.createPortalUser() as this method returns me null which seems obvious. but is there any option to let this loggedin customer portal create another portal user under same account.

 

Suggestions please!

 

Thanks in advance.

Anup JadhavAnup Jadhav
You can add a VF page on a Sites page (accessible only after logging in) that takes the "user names" of new members, and then call "Site.createPortalUser" by passing in the username, account id etc to create new portal users under an existing account. Does that make sense?

anup
sfdcchampionssfdcchampions

Hi Anup,

 

Thanks for your response,I tried same way but this method is returning me null. ( when i am already logged in as a portal user from sites though i used the same method to register the first user.)

 

So what i concludede is i am able to create a user when i am a guest not when i am logged in as portal user.

 

Let me know if you have some thaughts!

 

Thanks again.