Skip to main content

Return to TX Community

Liaison

Additional Recommended Configurations

Configure the error message for a Duplicate Community User

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.

  1. Navigate to Setup and search for Custom Labels.
  2. Select to Edit the Duplicate User Exists record.
  3. Edit the Value information to reflect the appropriate information for your institution.
  4. Save your changes.

Configure CAPTCHA for the Self-Registration Page

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.

EDA Administrative Account creation and assignment on registration

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.

  1. Navigate to Setup and search for Apex Classes.
  2. Locate TX_CommunitiesSelfRegController and select Edit.
  3. Search for: match existing contact and place your cursor after the line: Contact[] cs =

TX_CommunitiesSelfRegController update

  1. Insert the following code:
// 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() ;
  1. Remove the '//' in front of the last line above, for example:
if(cs.size() == 0 && !hasDuplicateUser(email)) cs = insertContactFirst() ;
  1. Scroll to the top of the Apex Class.
  2. After the line public without sharing class TX_CommunitiesSelfRegController... add the following section of code:
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] ;
}
  1. Save your changes.

Note: You must ensure you have some way for accounts to be set to an owner with a role. 


 

Update your Community Registration Site to be compatible with EDA

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.

 

  1. Navigate to Setup and search for Apex Classes.
  2. Click on the TX_CommunitiesSelfRegController.
  3. Click Edit
  4. Locate the following code:
if (String.isNotBlank(accountId) && !cs.isEmpty() && cs[0].AccountId != defaultAccountId && cs[0].AccountId != accountId) { update new Contact(Id=cs[0].Id, AccountId=accountId);
}
  1. Replace the above code with the following:
// 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);

}
*/
  1. Uncomment the code in Step 3 according to your Org configuration of EDA.
  2. Locate the following code:
accountId = String.isBlank(accountId) ? cs[0].AccountId : accountId;
  1. Replace the above code with the following:
// 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;
  1. Uncomment the code in Step 6 according to your Org configuration of EDA.
  2. Save your changes.

 

  • Was this article helpful?