Salesforce CPQ: Price Editable?

  • Blog
  • Salesforce CPQ: Price Editable?
blog image
5
Sep

Salesforce CPQ (Configure, Price, Quote) can be a game-changer for businesses looking to streamline their quoting process. One common question that often comes up is, "Can the price field be editable? Or Non-editable?" The short answer is, yes! 

In this blog post, we'll explore two specific use cases that involve editing price fields, the challenges, and solutions to these issues. Let's dive in.

Use Case 1: Locking List Price for Specific Profiles

Imagine a situation where you're using CPQ for quotes, and you want to restrict the editing of the List Price field for all profiles, with the exception of two specific ones. If you've unticked the SBQQ__PriceEditable__c checkbox for all your products, you've effectively made it so no one can edit prices.

But how can you provide some flexibility for those two special profiles?

Solution:

The solution is to use a Price Rule to modify the 'Price Editable' field directly on the Quote Line (by default this value is inherited from the product's Price Editable field). Price Rules in Salesforce CPQ provide the ability to dynamically alter a wide range of field values, based on various conditions. These adjustments go beyond pricing, making Price Rules a versatile tool for many aspects of your quote configuration process.

To isolate specific profiles, you could create a custom formula checkbox field on the Quote, named something like "Profile Eligibility". This checkbox would be configured to return 'true' when the profile is one of the selected profiles permitted to edit the price.

This custom "Profile Eligibility" field would then be leveraged in the Price Rule Conditions, ensuring that only users with the specific profiles can edit the List Price, enforcing the necessary pricing controls.

Use Case 2: Locking a Custom Price Field for Specific Profiles

The second use case involves using CPQ for quotes while wanting to lock a custom price field that you've added to the Line Editor field set on the quote line object (Sales_Price__c) for all profiles except for two.

Solution:

The 'Price Editable' functionality is designed to work with the 'List Price' (SBQQ__ListPrice__c), provided that the price method on the products is set to 'List'. When it comes to custom fields, we need a more tailored solution.

Here, you can employ a Javascript Page Security Plugin. This plugin allows you to control field visibility and editability on your CPQ quotes using Javascript functions.

To create a page security plugin, you'll first define your code in a custom script record. 

This custom script record's name will then be referenced in the Quote Calculator Plugin field within the Salesforce CPQ Plugin package settings.

If you're already using a quote calculator plugin, don't worry. You can simply add your page security plugin code to the same place. This way, both plugins can work together without any conflict. The Javascript Page Security plugin supports several functions, including isFieldVisibleForObject and isFieldEditableForObject, which control field visibility and editability. When using these functions, if the result is 'False', Salesforce CPQ will lock or hide the fields you've picked. However, if the result is 'Null' or 'True', your fields won't be changed.

For example, if you want to target the 'Sales_Price__c' field, your code might look something like this:

export function isFieldEditableForObject(fieldName, line, conn, objectName){
  if (objectName === 'QuoteLine__c' && fieldName === 'Sales_Price__c') {
    //Check for Profile Eligibility...
   if (line.SBQQ__Quote__r.Profile_Eligibility__c) {
      return true; // Field is editable when Profile Eligibility is true.
    } else {
      return false; // Field is locked when Profile Eligibility is false.
    }
  }
}

As you can see, Salesforce CPQ is capable of tremendous flexibility once you understand its inner workings. By using Price Rules or a Javascript Page Security Plugin, you can use the 'Price Editable' field as needed to meet your specific business requirements. 

Keep in mind that in Salesforce CPQ, you can't change prices or discounts on existing lines on amendment quotes. In simple terms, once prices are set in a contract, they can't be changed. If you need to update prices mid-term, you need to 'cancel' the current quote lines. You do this by setting their quantity to zero and then quoting the same product again at the new price. This way, your amendment process stays consistent.

Comments (0)

Leave a Comment