This message will surface if an existing user attempts to register again. It is recommended that this message redirect the user to the “Forgot Password” option or reach out to a contact at the institution for additional assistance.
It is highly recommended that all institutions configure CAPTCHA for communities to mitigate the risk of a bot attack resulting in depletion of community login licenses. Refer to the article Configuring CAPTCHA for details.
If the institution has implemented the EDA Administrative Accounts model, these instructions update the registration apex class to automatically create an Administrative Account when a new Contact is created. Complete ONLY Steps 1-5. Note: You must ensure you have some way for accounts to be set to an owner with a role.
Communities is an unmanaged package. To access this functionality, you need to update the TX_CommunitiesSelfRegController.
Note: This update can only occur within sandbox, and then perform a change set to Production to save those changes.
For additional information, please see: Deploying from Sandbox with Change Sets.
Contact[] cs =
// Uncomment the following line if you want to use HEDA's administrative accounts. // NOTE: You will also need to make sure you have some way for account to be set to an owner with a role // on creation. By default, accounts will be created by the guest user and fail. //if(cs.size() == 0 && !hasDuplicateUser(email)) cs = insertContactFirst() ;
if(cs.size() == 0 && !hasDuplicateUser(email)) cs = insertContactFirst() ;
private Contact[] insertContactFirst() { Contact c = new Contact() ; c.FirstName = firstName ; c.LastName = lastName ; c.Email = email ; insert c ; return [SELECT Id, AccountId, Account.OwnerId, Account.Owner.UserRoleId FROM Contact WHERE Id = :c.Id] ; }
Note: You must ensure you have some way for accounts to be set to an owner with a role.
If the institution has implemented the EDA Administrative Accounts model, these instructions outline how to point the School Picker to the Primary Educational Institution field on the Contact record.
Note: You MUST complete the steps in a sandbox environment before pushing to production via an Outbound Change Set.
if (String.isNotBlank(accountId) && !cs.isEmpty() && cs[0].AccountId != defaultAccountId && cs[0].AccountId != accountId) { update new Contact(Id=cs[0].Id, AccountId=accountId); }
// Uncomment the following lines if HEDA is not enabled. /* if (String.isNotBlank(accountId) && !cs.isEmpty() && cs[0].AccountId != defaultAccountId && cs[0].AccountId != accountId) { update new Contact(Id=cs[0].Id, AccountId=accountId); } */ // Uncomment the following lines if HEDA is enabled. /* if (String.isNotBlank(accountId) && !cs.isEmpty()) { update new Contact(Id=cs[0].Id, Primary_Educational_Institution__c = accountId); } */
accountId = String.isBlank(accountId) ? cs[0].AccountId : accountId;
// Uncomment the following line if HEDA is not enabled //accountId = String.isBlank(accountId) ? cs[0].AccountId : accountId; // Uncomment the following line if HEDA is enabled. accountId = cs[0].AccountId;