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
Rich FiekowskyRich Fiekowsky 

How can I prevent a Quote from containing both of two products?

Hi, We have Salesforce CPQ installed and in use. Our Quotes and Orders can have multiple Products. One requirement we have is: two particular Products cannot both be on the same quote. Each can be quoted, but both shouldn't be quoted (and ordered) together. They are mutually exclusive.
I suppose we can write a trigger to enforce that.
Is there a way to do it with clicks not code?  
Best Answer chosen by Rich Fiekowsky
Andrew GAndrew G
Product Rules.
Create a product rule similar to below:
User-added image
Then create 2x Actions

Type: Hide & Remove
Product : Product A
Filter field: Product code (or what ever identifier works)
Operater : Equals
Filter Value : Product Code for Product B.

In second action, reverse the Product and filter values.

Save and Test.


Regards
Andrew
 

All Answers

Andrew GAndrew G
Product Rules.
Create a product rule similar to below:
User-added image
Then create 2x Actions

Type: Hide & Remove
Product : Product A
Filter field: Product code (or what ever identifier works)
Operater : Equals
Filter Value : Product Code for Product B.

In second action, reverse the Product and filter values.

Save and Test.


Regards
Andrew
 
This was selected as the best answer
Kevin ZawKevin Zaw

Hi Rich,

You would need to create a Validation Rule where the Conditions Met is Custom and the Advanced Condition is the combination of error conditions that can't appear simutaneously. I've outlined a demo of how, theoritically, this should appear. You may want to change up the product rule I've created so that it makes sense to your use case, but I think it's a good demonstration of what I'm referring to. You don't need to create any Actions with Validation Rules. The action is your message. 

User-added image
User-added image
User-added image
User-added image
User-added image

Kate KilpatrickKate Kilpatrick
Thank you Kevin - your solution was very helpful.