• Published
  • Create a Tag Setting


    This page covers:

    Related pages:


    Tag Settings?

    Tag Setting records define the parameters for the tagging interface, including which objects the M2M component appears on, which object records populate the tag values, and the filtering of those records.

    In the junction object configuration, we defined two objects:

    • Catalog Object - which is the object where the catalog of tags will be created as records;

    • Target Object - which is typically the object where the M2M component is added to allow users to tag Target object records with tags (or records) from the Catalog object.

    Once this is set up, you can dive into the Tag Setting setup below.

    In the example we’ll use throughout, the “Contact Full Name” (tags) will be tagged onto “Account” records (target) which creates an “Account Contact” junction record between “Contact” and “Account”.


    Create & Name the Tag Settings Record

    Navigate to the “Tag Settings” object and click on “New” to create a new Tag Settings record.

    We recommend using a consistent format when naming Tag Settings records to easily identify Tag Setting records. In general, when naming Tag Settings, the record should follow this format: “Tag {TargetObject} with {CatalogObject}s”. For example: “Tag Contacts with Account” for a Tag Setting record that allows the user to create Account tags on the Contact object.


    Tag Settings Setup Wizard

    Once a Tag Setting record has been created, use the Setup Wizard that renders upon saving the record to populate the object API names and related settings.

    The wizard dynamically displays a dropdown list of compatible standard and custom objects in the system. All custom objects will be included. The standard objects include:

    • Account

    • Asset

    • Campaign

    • CampaignMember

    • Case

    • Contact

    • Contract

    • Event

    • Lead

    • Opportunity

    • OpportunityLineItem

    • Order

    • OrderItem

    • PricebookEntry

    • Product2

    • Task

    • User

    Catalog Object Setup

    This is where you define the details for the Catalog record (tags) display.

    To customize the display of the tags on the Target object, complete the “Catalog Settings”:

    1. Catalog Object Display Field: The field of a selected Catalog object or of a related object you wish to tag onto the Target Object. This field defaults to the “Name” field for the selected object. This is displayed above the tagging component in the Target object. In our example, “Tag Contacts” is displayed above the component on the Account object.

    2. Catalog Header Label: Use this field to specify a label for the tagging component. Coincidentally, in our example, this is also “Tag Contacts”.

    3. [Optional] Select Rollup Field: This is an optional step to select the field on the Catalog object where you would like to see comma-separated Display Field values of the tagged Target Object. This picklist displays only those fields whose field type is Text or TextArea (Including LongTextArea and RichTextArea) and exists on the selected Catalog object. The comma-separated values on Rollup Fields are useful for creating and filtering reports on related objects.

    4. Should all Catalog Object records available for tagging?: This field allows you to filter the Catalog object records based on predefined criteria. See the section on record filtering below.

    Target Object Setup

    This is where you define the details for the Target record display.

    Target object note: This part of the setup can become confusing but let’s clarify: Due to the junction object configuration, you can technically achieve tagging in both directions.

    1. Tag Catalog object records onto the Target object (in our example, tag Contacts with Accounts), or

    2. Tag Target object records onto the Catalog object (in our example, tag Accounts with Contacts).

    There aren’t many use cases for tagging in both directions. Mostly, organizations have a true “Catalog” (list of tags) and “Target” object and only do tagging in one direction.

    The details below outline how you’d configure tagging in the opposite direction as well.

    To customize the display of the tags on the Target object, complete the “Catalog Settings”:

    1. Target Object Display Field: The field of a selected Target object or of a related object you wish to tag onto the Catalog Object. This field defaults to the Name field for the selected object.

    2. Target Header Label: Use this field to specify a label for the tagging component.

    3. Select Rollup Field: This is an optional step to select the field on the Target object where you would like to see comma-separated Display Field values of the tagged Catalog Object.

    4. Should all Target Object records available for tagging?: This field allows you to filter the Target object records based on predefined criteria. See the section on record filtering below.

    Junction Object Setup 

    The final screen of this Flow is to link the Catalog and Target Objects to the Junction Object.

    The following fields ensure that the correct relationships exist between the Junction record and the Tag, Target, and Tag Settings records:

    • Junction's Target Field: The name of the lookup/master-detail from the Junction object to the Target object

    • Junction's Catalog Field: The name of the lookup/master-detail from the Junction object to the Catalog object

    • Junction's Tag Setting Field: The name of the lookup from the Junction object to the Tag Settings object

    • Junction's Tag Date Field: The name of the date field that is populated on the creation of the junction record

    • Junction's Archive Date Field: The name of the date field that is populated on archiving of the junction record

    It is possible to create multiple Tag Settings i.e. settings between a Target Object and multiple Catalog Objects. While the options in the drop-down display the object/field label, the actual value stored in the Tag Settings record is the object/field API Name.

    Click “Next” to review the details of the records you created.


    Apply Filters on Catalog, Target, & Child Object Records

    Often organizations need to filter the list of available tags from the Catalog object to streamline the user experience and ensure that users only see the tags they need.

    1. From the Tag Settings wizard on the Setup tab, there is a toggle button next to “Should all Catalog Object records available for tagging?”. Switch it to “No” to expose the filter condition fields to define the filter logic.

      1. The dropdown to “Apply these filters when” defines how the following criteria will be applied to the records. There are two options: “All of these conditions are met” (AND logic)  and “One of these conditions are met” (OR logic). 

    2. Next, add your filter criteria.

      1. Catalog Object Field: Once you select the Catalog Object field from the first dropdown, a new Catalog Object Field picklist appears displaying fields from the related Object. Select a field from this picklist.

      2. Choose the Operator.

      3. Type: Select “Field Reference” from the Type picklist if you would like to filter the records available for tagging according to a dynamic condition, or select “Constant” if you wish to filter according to a static value. 

      4. Click on the “+” sign to add a new filter. When editing the custom filters within a Tag Setting, check that the changes you have made are saved after clicking the Save button. Should you not see the changes you made, re-edit the setting to ensure the changes are saved.

    3. The following table includes the supported field types and their corresponding operators:

    Field Type

    Available Operators

    Field Type

    Available Operators

    Date

    equals, not equal to, less than, greater than, less or equal, greater or equal

    Date-Time

    equals, not equal to, less than, greater than, less or equal, greater or equal

    Number (Integer, Double, Currency, Percent)

    equals, not equal to, less than, greater than, less or equal, greater or equal

    Phone

    equals, not equal to, contains, not contain, start with

    Text

    equals, not equal to, contains, not contain, start with

    Picklist

    equals, not equal to, contains, not contain, start with

    Multiselect Picklist

    equals, not equal to, contains, not contain

    URL

    equals, not equal to, contains, not contain, start with

    Reference

    equals, not equal to, contains, not contain, start with

    Boolean

    equals, not equal to

    Id

    equals, not equal to, contains, not contain, start with

    Email

    equals, not equal to, contains, not contain, start with

    RecordType Name

    equals, not equal to, contains, not contain, start with

    When filtering using Date-Time or Date and no value has been saved for the respective field, a Salesforce system error will appear on clicking into the Tagging UI component. In order to resolve this issue, please ensure the values have been saved in the appropriate field.


    Filter child object records by up to two different child objects. The same filter logic specified above also applies to the child objects.

    In our example, we could filter “Accounts” by their “child Contacts” with a condition such as, “only show those Accounts that have a child Contact name equals to 'Jane Doe'“.  


    Archive Mode

    Tags are automatically set to delete the junction record on the removal of a tag from the M2M component. If tags need to be archived for reporting purposes, ensure that the “Archive Mode” checkbox field is selected as “TRUE” while creating the Tag Setting record.

    When Archive Mode is activated, the following fields must be populated:

    • Junction Object Tag Date Field: The Date Field on the junction object that is populated whenever a tag is added through the component in Archive Mode. 

    • Junction Object Archive Date Field: The Date Field on the junction object that is populated whenever a tag is removed through the component in Archive Mode. 

    Both the “Tag Date” and “Archive Date” fields may be added to the Junction Object as custom fields from Object Manager - see configuration guidance here.