Define Custom Apex Class Logic to Create Associations
Record Association Builder gives you the flexibility to fully customize how association records are created by using a custom association handler Apex class.
Required Editions
| Available in: Lightning Experience |
| Available in: Professional, Enterprise, and Unlimited Editions |
By default, Record Association Builder uses the Owner ID field on a standard or custom object when creating association records. You can specify a different ID field by selecting Use an alternate owner ID for the association criteria. The alternate owner ID field must link to a user or contact object that’s enabled for use as a Banker. If your custom object or alternate owner ID field doesn’t meet that requirement, you can program custom logic to create association records a different way.
Record Association Builder lets you specify a custom Apex class to handle the creation of association records for a specific association criteria. The custom Apex class must:
- apply to an object that isn’t directly supported the Record Association Builder;
- implement the fscwmgen.BranchManagementAssociationHandler interface;
- return a list of Branch Unit Related Records;
- populate at least the minimum required fields in each Branch Unit Related Record:
- BranchUnitId: Represents the current branch unit of the user or contact
- BusinessUnitMemberId: The Banker ID of the user or contact
- RelatedRecordId: The ID of the custom object to be related
To specify a custom association handler Apex class for an association criteria:
- On the New Criteria or Edit Criteria page, make sure that the Use an alternate owner ID checkbox is checked.
-
Specify the alternate ID field to use:
- Click the search box that says Select a field on the reference object....
- In the Select a Field window use the filter control to find and select the ID field to use.
- Click Choose to select that field.
- Click the Use Apex class checkbox.
-
Click the search box that says Search Apex Classes.... Specify an
Apex class that implements the
fscwmgen.BranchManagementAssociationHandler interface.

- Save your work.

