Configure object-sensitive filters
  • 16 Jul 2024
  • 3 Minutes to read
  • Dark
    Light

Configure object-sensitive filters

  • Dark
    Light

Article summary

In addition to standard filter fields that search for values on a specific field of the Line object, you can add filters for values that are associated with line records but not explicitly stored on a field of that line record.

You can configure one or more Post-Processable Filter Fields for the Line Items component or Workspace to enable filtering by fields that don't exist on an agreement or quote line. Users then complete Post-Processable Filter Fields and the application uses the provided field values to display only the associated records, based on the logic that is specific to that implementation.

For example, a product is assigned to multiple marketing packages but you want to enable users to filter out the lines that are for that product in a specific package. Because of the many-to-many relationship between products and marketing packages, searching a single field associated with the line does not work but it is possible when using this feature.

Use the following procedures to configure object-sensitive filters

  1. Add one or more Post-Processable Filter Fields to the filter field set that you are using. Each of the Post-Processable Filter Fields is tied to a business object. The records in that business object are the options the user can select.
  2. For each Post-Processable Filter Field, use one or both of the following options:
    1. Create a Boolean formula field that calculates whether the record is shown as an option (Filtering Formula Field).
    2. Write an Apex class that will calculate whether the record is shown as an option (Picklist Configurer Class Name).
  3. Write an Apex class that determines which lines to show in the list based on the values selected for all Post-Processable Filter Fields (Filter Field Post-Processor Class).

For more information on the Apex hooks, read:

Prerequisites

Before configuring this feature, make sure that the following fields are visible and can be edited:

  • Post-Processable Filter Field object:
    • Post-Processable Filter Field Name
    • SObject Type Name
    • Filtering Formula Field
    • Picklist Configurer Class Name
    • Filter Field Post-Processor Class
    • Field Order
    • Sort Condition
    • Search Configuration

If the fields are not visible or can't be edited, confirm that they have been added to the object's page layout and are visible in the user's profile. For detailed instructions on how to add fields and check for visibility, refer to Make fields visible or editable.

Configure basic post-processable filter fields

  1. From the Lightning App Launcher, go to the appropriate Product Selector Configuration (or the Workspace Configuration for Workspace).
  2. On the Details tab, go to the Line Filter Field Set (for Line Items) or to the Workspace Filter Field Set (for Workspace).
  3. In the Post Processable Filter Fields Related list, create a record for a desired filter:
    • Post Processable Filter Field Name—Enter a descriptive name for the object-type filter that will appear on top of the dropdown.
    • Field Order—Enter the order of post-processable filters in this Filter Field Set.
    • Filter Field Post-Processor Class—Enter the name of the Apex class with the custom filtering logic. Read more information on the Apex hook here.
    • Picklist Configurer Class Name—Specify the name of the Apex class with custom logic on providing picklist options. Read more information on the Apex hook here.
    • SObject Type Name—Enter the API name of the object. This object's records will appear in the dropdown list.
    • Filtering Formula Field—(Optional.) Enter a valid Salesforce field value that will determine whether to show or hide options in a dropdown list. If the Filtering Formula Field value evaluates to TRUE, a certain object is shown. It is not shown when the field evaluates to FALSE.
      The following conditions apply:
      • The Filtering Formula Field must be of type Checkbox or Formula (Checkbox).
      • The Filtering Formula Field must be a field on the Salesforce object whose API name matches this Post-Processable Filter Field's SObject Type Name.
      • You can check if the value in the Filtering Formula Field is valid and can be used in the Post-Processable Filter Field.
    • Sort Condition—(Optional.) Enter the condition for the sorting of records in the post-processable filter field dropdown list.
      The following rules apply:
      • The field accepts pairs of fieldName direction ordering. For example, Name ASC.
      • The field supports the ASC and DESC ordering. The default ordering is ASC.
      • The fieldName value must be a valid field on the linked object.
      • For multi-column sorting, each pair should be specified on a separate line.
    • Search Configuration—(Optional.) Select a Search Configuration to use. If selected, the search box will appear for the Post-Processable Filter on the Line Items/Workspace to help you search for the values in the dropdown.
  4. Select Save.

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.