function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rachel Linder 20Rachel Linder 20 

CPQ - What is the Best Practice for Restricting/Allowing Products to Be Sold in Certain States

Let me preface this with - we are hoping to find a simpler way to manage this. Maybe a product rule that uses lookup queries. As this is currently  holding up the release of a product for selling and quoting.

Also, note that these are all standalone products and not bundled products.

We have 9 product rules that are set to restrict specific products from being sold in certain states. We are trying to add a product to these rules to restrict where they are sold. For example, this particular product it CAN BE sold in CA, MI, NY, AZ, IL, and NJ. I added this product to the three rules that would allow this product to be sold in CA and MI (in the screenshots Product Rule 1 (CA), Product Rule 2 (CA and MI), and Product Rule 3 (MI)).

Below are the product rules:

User-added imageUser-added image

I then wanted to test to see the result of adding the product to a quote for those states.

When I add the product to a California quote I get the following error: "Product unavailable for this state. Please remove to continue. (ISE, ISI)" That error is the validation message for Product Rule 3 for Michigan. Why would it give the error for Michigan when the quote is for California and it can be sold in California?

I then tested adding the product to a Michigan quote and I get the following error: "Product unavailable for this state. Please remove to continue. (SPARCS, ISI)". That error is the validation message for Product Rule 1 for California. Why would it give the error for California when the quote is for Michigan and the product can be sold in Michigan?

I believe it has to do with evaluation order. The evaluation order for Product Rule 1 (CA) is 380, the evaluation order for Product Rule 2 (CA and MI) is 400, and the evaluation order for Product Rule 3 (MI) is 390.

What we do need to do is to be able to add this product to all rules where it needs to be sold as well as possibly add a rule for additional states. Is there a better way to handle this instead of several individual product rules?

We need direction on the best way to handle state restrictions for standalone products as well as bundles. 

Can this be done by creating a product rule that uses lookup queries? If so, I have started to try and design this. This is what I believe would need to be done using lookup queries within a product rule:
  1. We would need to somehow default the Quote Billing State to a configuration attribute.
  2. How would we build the configuration attribute if we do the above?
  3. We would use the Lookup Data object that is provided with CPQ. I have created some required fields for the lookup query - Billing State and Billing City. We would still use the standard Product Field, Type Field, and required field. In the lookup data object the type would be Show or Hide & Remove.
  4. Build a product rule. Here is a sample of a product rule that I started. Hoping I am on the right track.
  5. User-added image
  6. Lookup Query - I am not sure how to build that as I believe it will need refer to the configuration attribute as the match type, Billing State as the Tested Configuration Attribute, Operator of Equals, and Lookup Field would be the Billing State.
Any direction with screenshots would be extremely helpful.
Best Answer chosen by Rachel Linder 20
Rachel Linder 20Rachel Linder 20
I used a Lookup Queries with a Product Rule and Price Rule

All Answers

Rachel Linder 20Rachel Linder 20
I used a Lookup Queries with a Product Rule and Price Rule
This was selected as the best answer
GessicaGessica
Hi, by any chance could you share more info on how you went about doing this? I have a product and I would like to resist its access to only be visible to the APAC and India region. Thanks