You can define a formula action to configure products directly from any page in the org without having to navigate through the Catalog or Cart page. The custom button allows the Sales rep to configure products from any other page in the org by opening the Configuration page of the product directly. The Sales rep can configure attributes, options, sub-bundles on the Configuration page. For example, you can add the custom button on the Quote Detail page or the Line Item Detail page.

You can define the custom button to either add a new product to the cart or edit an existing product in the product configuration which is saved or finalized. The formula for the custom button is different based on the functionality you want to define. 

You must modify URL structures to either add a new product to the cart or edit an existing product in the product configuration. 

  • You must use the following structures of URL to navigate directly to the Configuration page.

    TaskURL
    Add a new product

    <instanceURL>/apex/Cart#/flows/<flow name>/businessObjects/<businessObjectsId>/products/<productId>/configure

    Edit an existing product in the quote

    <instanceURL>/apex/Cart#/flows/<flow name>/businessObjects/<businessObjectsId>/lines/<primaryLineNumbers>/configure

  • To modify the URL you must gather the following values.

    ValueDescription
    Instance URLYou can find the Instance URL from the URL of any page in your org. For example, https://cpq--test.my.salesforce.com/apex/Apttus_Config2__Cart#!/flows/CartGrid/businessObjects/a0Y7A000001kWce/products/01t3C000002Rao3/configure.
    Flow name

    The name of the flow using which you want to configure your product.  For example, https://cpq--test.my.salesforce.com/apex/Apttus_Config2__Cart#!/flows/CartGrid/businessObjects/a0Y7A000001kWce/products/01t3C000002Rao3/configure.

    Smart Cart flows and Partner Portal are not supported.

    Business Object IDThe ID of your quote/proposal, order, or agreement which you can find in the URL of the Quote Detail page. For example, https://cpq--test.my.salesforce.com/apex/Apttus_Config2__Cart#!/flows/CartGrid/businessObjects/a0Y7A000001kWce/products/01t3C000002Rao3/configure.
    Product ID

    The ID of the product which can find in the URL of the Product Detail page. You need the ID of the product to add a new product to the cart. For example, https://cpq--test.my.salesforce.com/apex/Apttus_Config2__Cart#!/flows/CartGrid/businessObjects/a0Y7A000001kWce/products/01t3C000002Rao3/configure.

    In the following scenarios, the Sales rep is directed to the Catalog page instead of the Configuration page and CPQ displays anerror message:

    • The Product ID provided is incorrect
    • The Product ID belongs to a different price list that is not associated with the Business Object
    • The Business Object is not associated with any price list.
    Primary Line NumerThe Primary Line Number of a product is generated on the line item after the product is added to the cart. You can find the Primary Line Number of the product on the Line Item Detail page. You need the Primary Line Number of the product to edit an existing product in the configuration. For example, https://cpq--test.my.salesforce.com/apex/Apttus_Config2__Cart#!/flows/QuotingCartGrid/businessObjects/a0Y7A000001kWce/lines/1/configure.

The following use cases describe how to define both the functionalities. The custom button on the Quote Detail page allows the Sales rep to add a new product or service each time the button is clicked. However, the custom button on the Line Item Detail page allows the Sales rep to update and modify the existing product or service.

Custom Button on Quote Detail Page to Add a New Product

On the Quote Detail page, the Sales rep must provide the URL of the product or service in a custom text field to open the Configuration page for that product or service. When the Sales rep clicks the custom button on the Quote Detail page, the product or service corresponding to the URL provided in the custom text field is added to the cart and the Configuration page of that product is displayed. If the Sales rep clicks the button multiple times, the same product is added to the cart again. You must create a custom text field on the Quote/Proposal object where the Sales rep can enter the product URL.

Pre-requisite

Create a custom text field in the Quote/Proposal object.

To create a custom button on Quote Detail page

  1. Go to Setup > Create > Objects and search for Quote/Proposal object.
  2. In the Custom Fields & Relationships related list, click New.
  3. From Step 1. Choose the field type, choose Formula as Data Type, and click Next.
  4. From Step 2. Choose the output type, Type Configure (Flow) in the Field Label. Choose Text as Formula Return Type.
  5. In Step 3. Enter formula, paste the following URL under the Simple Formula tab and click Next:

    IF ( LEN( Apttus_QPConfig__PriceListId__c ) > 0 , HYPERLINK("/apex/Apttus_Config2__Cart#!/flows/CartGrid/businessObjects/" &Id & "/products/"&ProductId__c&"/configure" , IMAGE("/resource/Apttus_Config2__Button_Configure", "Configure Products"),"_self"), NULL)
    CODE

    Ensure that you enter the name of your Flow setting in the flow parameter in the above formula. In our example, it is CartGrid.

    Ensure that you replace ProductId__c with the name of the custom text field that you created in the Quote/Proposal object.

  6. Select appropriate Field Level Security and click Next.
  7. Choose the page layouts on which you want to display this field.
  8. Click Save.

Custom Button on Line Item Detail page to Edit an Existing Product

You can add the custom button on the Line Item Detail page to allow the Sales rep to update or modify the existing product configuration of a product. The formula for the custom buttons refers to the Primary Line Number that is generated by CPQ upon adding a product to the cart, to open the Configuration page for the specific product or service.

To create a custom button on the Product Configuration page

  1. Go to Setup > Create > Objects and search for Line Item object.
  2. In the Custom Fields & Relationships related list, click New.
  3. From Step 1. Choose the field type, choose Formula as Data Type, and click Next.
  4. From Step 2. Choose the output type, Type Configure (Flow) in the Field Label. Choose Text as Formula Return Type.
  5. In Step 3. Enter formula, paste the following URL under the Simple Formula tab and click Next:

    IF ( LEN( Apttus_Config2__PriceListId__c ) > 0 && TEXT(Apttus_Config2__LineType__c) = "Product/Service" , HYPERLINK("/apex/Apttus_Config2__Cart#!/flows/CartGrid/businessObjects/" & Apttus_Config2__ConfigurationId__r.Apttus_QPConfig__Proposald__c & "/lines/" & TEXT(Apttus_Config2__PrimaryLineNumber__c)&"/configure", IMAGE("/resource/Apttus_Config2__Button_Configure", "Config"),"_self"), NULL)
    CODE

    Ensure that you enter the name of your Flow setting in the flow parameter in the above formula. In our example, it is CartGrid.

  6. Select appropriate Field Level Security and click Next.
  7. Choose the page layouts on which you want to display this field.
  8. Click Save.