SAP Knowledge Base Article - Public

3234818 - Pricebook Visibility Edge Case

Symptom

This KBA will outline a workaround that will need to be added as a custom script if a specific use case described below, using the Pricebooks, has been setup.

Environment

SAP SALES CLOUD CPQ

Reproducing the Issue

  • An error message will appear if a selected Pricebook in a Quote is no longer available due to the Visibility Formula not being met.
    This error message will not appear if the following has been setup.
  • A user's default Market must not have any Pricebooks visible when a Quote is created. Two or more Pricebooks contain a Visibility Formula that uses a Custom Field's value and the formulas do not return True initially.

Example: The Market Austalia in $ contains two Pricebooks named TestPricebook2 and TestPricebook3, each with a Visibility Formula so that no Pricebook is selected by default.

Pricebook: TestPricebook2

Visibility Formula: [EQ](<*CTX(Quote.CustomField(Pricebook Visibility))*>,Yes)

Pricebook: TestPricebook3

Visibility Formula: [EQ](<*CTX(Quote.CustomField(Pricebook Visibility))*>,No)

Creating a New Quote with this setup will show no Pricebook visible.

  • Once the Custom Field used in the Formula has been set, then the corresponding Pricebook will be visible. Changing the Custom Field again to meet the other Pricebook's Visibility Formula will cause no error to occur and the Pricebook that should no longer be visible is still selected.

"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental."

Resolution

The following workaround can be added so that the behavior described above will cause an error message to appear to inform users that the selected Pricebook is not valid.

1) Go to Setup -> Develop -> Global Scripts and create a new custom script

2) Add the following line to execute the Save Quote action:

Quote.ExecuteAction(19)

Note: Using Quote.Save() in the script instead will not work.

3) Attach the script to the event After changing value of custom fields and search for the Custom Field being used in the Pricebook Visibility Formula.

4) Set the script to Active and save.

5) Create a New Quote and perform the steps to check if a Pricebook is still available if the Visibility Formula is no longer valid and you will receive the error as shown in the screenshot below:

"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental."

Keywords

Pricebook, Visibility, custom script , KBA , CEC-SAL-CPQ , Sales Cloud CPQ , How To

Product

SAP CPQ all versions

Attachments

Pasted image.png
Pasted image.png
Pasted image.png
Pasted image.png
Pasted image.png
Pasted image.png