AccountCreator Interface
Creates Account records that will be associated with Chatter Answers users.
The ChatterAnswers.AccountCreator is specified in the registrationClassName attribute of a chatteranswers:registration Visualforce component. This interface is called by Chatter Answers and allows for custom creation of Account records used for portal users.
To implement the ChatterAnswers.AccountCreator interface, you must first declare a class with the implements keyword as follows:
Next, your class must provide an implementation for the following method:
The implemented method must be declared as global or public.
The following are methods for AccountCreator.
-
createAccount(firstName, lastName, siteAdminId)
Accepts basic user information and creates an Account record. The implementation of this method returns the account ID.
Accepts basic user information and creates an Account record. The implementation of this method returns the account ID.
public String createAccount(String firstName, String lastName, Id siteAdminId)
-
firstName:
Type: String
The first name of the user who is registering.
-
lastName:
Type: String
The last name of the user who is registering.
-
siteAdminId:
Type: ID
The user ID of the Site administrator, used for notification if any exceptions occur.
Type: String
This is an example implementation of the ChatterAnswers.AccountCreator interface. The createAccount method implementation accepts user information and creates an Account record. The method returns a String value for the Account ID.
This example tests the code above.