Loading
Salesforce now sends email only from verified domains. Read More
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Define Custom Apex Class Logic to Create Associations

          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:

          1. On the New Criteria or Edit Criteria page, make sure that the Use an alternate owner ID checkbox is checked.
          2. Specify the alternate ID field to use:
            1. Click the search box that says Select a field on the reference object....
            2. In the Select a Field window use the filter control to find and select the ID field to use.
            3. Click Choose to select that field.
          3. Click the Use Apex class checkbox.
          4. Click the search box that says Search Apex Classes.... Specify an Apex class that implements the fscwmgen.BranchManagementAssociationHandler interface.
            Specify an alternate owner ID and Apex class handler
          5. Save your work.
           
          Loading
          Salesforce Help | Article