Updating your Community Registration Site to be compatible with EDA
Note: You MUST complete the steps in a sandbox environment before pushing to production via an Outbound Change Set.
- Navigate to Setup and search for Apex Classes.
- Click on the TX_CommunitiesSelfRegController.
- Click Edit.
- 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); }
- 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); } */
- Uncomment the code in Step 3 according to your Org configuration of EDA.
- Locate the following code:
accountId = String.isBlank(accountId) ? cs[0].AccountId : accountId;
- 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;
- Uncomment the code in Step 6 according to your Org configuration of EDA.
- Save your changes.