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
John naJohn na 

Community user self-registration for multiple orgs: CommunitiesSelfRegController

Dear Community,

The default page for a user to self-register on is associated with one Account.  Is there any sample code around that allows an Account ID to be specified as part of the registration process?

Page 16 here:  http://help.salesforce.com/help/pdfs/en/salesforce_communities_implementation.pdf
mentions CommunitiesSelfRegController and states,
"d. Enter the account ID for the partner or customer account that users who self register should be associated with."

Thank you!!!
Best Answer chosen by John na
Phil WeinmeisterPhil Weinmeister
Hi John,

You can definitely avoid hardcoding the Account Id. I have made it configurable using a Custom Setting. Alternatively, you could modify the VF page and the controller to capture the Account Id as input (if the user knew the Account ID).

<apex:outputLabel value="Account" for="Account"/>
<apex:inputText required="true" id="Account" value="{!Account}" label="Account"/>

You'd have to then handle it in the controller (it's set up to be hardcoded by default).

Or, if you have a very basic list of Accounts, you could create a drop-down in your VF page and show the "friendly" account names and then associate these with the actual Account Id.

Let me know if that helps.