Dynamically Show Product List To Users Using Custom Action (Salesforce CPQ Volume 4)

Author: Rishabh Dubey

Custom Actions

Custom Actions are buttons that users can click to perform the action in the Quote Line Editor, configurator, or several other detail pages.

Custom Actions have different actions available based on where the custom action appears in Salesforce CPQ.

You can also create conditions for your Custom Actions. If your action contains conditions, Salesforce CPQ doesn’t show the action until your quote meets them.

Salesforce provides several custom actions you can enable in the Quote Line Editor.

  • Add Products
  • Add Favorites
  • Add Recommendations
  • Save
  • Quick Save
  • Reset Discounts
  • Delete Lines
  • Add Groups
Search Filters

Search Filters on the Quote Line Editor are used to filter Products based on their field values.

Admins can add search filters to custom actions. When the Sales rep clicks on Custom Action on the Quote Line Editor or configurator, it filters products based on Search filter parameters.

Dynamically show product list to users

We have two sets of users, Sales users and Service users. Our requirement is when a Sales user clicks on Add products from QLE they should be able to see all the products but when Service users click on Add products they should only be able to see the products where the product family is Support. (We have a segment field on the user object that tells us if the user is Sales or Service).

1. Create a Formula field on Quote that will tell us the segment of the current user.

  1. Go to Object Manager
  2. Go to Quote Object
  3. Click on Fields & Relationships
  4. Click on New
  5. Select Formula as data type
  6. Name the Field User Segment
  7. Select Text as Data Type
  8. Syntax: TEXT( $User.Segment__c )

2. Create a Custom Action for Support users.

  1. From the Salesforce CPQ application, open the Custom Action tab
  2. Click on New
  3. Name: Add Support product
  4. Active: True
  5. Display Order: Same as Display order of existing Add product Action
  6. Page: Quote Line Editor
  7. Location: Quote / Group
  8. Action: Add product
  9. Label: “Add Support product”

Label is a Picklist field and you may need to add your custom label as a picklist value for this field.

  • Go to Object Manager
  • Open Custom Action Object
  • Click on Fields & Relationship
  • Open Label Field
  • Click New on Values Section and add your Custom label to the Picklist values

3. Add a Search filter to your custom Action.

  1. Go to the Related list of your Add support Product Custom Action
  2. Click New on the Search filter related list
  3. Filter Name: support filter
  4. Target object: Product
  5. Target Field: product Family
  6. Operator: Equal
  7. Filter Value: Support
  8. Hidden: True (by selecting hidden, the filter will not show in UI but will still work on the backend)

4.  Add conditions to your custom Actions.

  1. Go to the Related list of your Add support Product Custom Action
  2. Click New on the Custom Action Condition related list
  3. Custom Action Condition Name: Support User
  4. Custom Action: Add support Product
  5. Target Object: Quote
  6. Field: User_Segment__c

“Field” is a Picklist field and you may need to add your Field’s API name (User_Segment__c) as a picklist value for this field.

  • Go to Object Manager
  • Open Custom Action Condition Object
  • Click on Fields & Relationship
  • Open field named “Field”
  • Click New on Values Section and add your fields API name
  1. Operator: Equal
  2. Filter value: Support

5. Add Condition To Existing Add product Custom Action.

As of now, there is no Condition in Add product Action hence the Add Product action will still be visible to Support Users. We want the support users to only see Add Support product Action not Add Product Action.

  1. From the Salesforce CPQ application open the Custom Action tab
  2. Open Add Product Action
  3. Go to the related List
  4. Click New on the Custom Action Condition-related list
  5. Custom Action Condition Name: Support User
  6. Custom Action: Add support Product
  7. Target Object: Quote
  8. Field: User_Segment__c
  9. Operator: Not Equal
  10. Filter value: Support

If we log in as a support user and click on edit line, then we will get the below View. We will only see Add support product Action not Add Product Action.

When we Click on this Action, only the Support Product will display.

We use cookies on this site to enhance your user experience. For a complete overview of how we use cookies, please see our privacy policy.