Print this page

Validation rule on the opportunities to have at least one related product

Knowledge Article Number 000213930
Description This rule will help to prevent opportunities being saved without adding a single product, after the creation of the opportunity record.
  • Create a Roll-up summary field on the opportunity Example- Number of Products. Reference - Roll up summary

  • Roll-up summary field to Opportunities that counts (COUNT) the number of Opportunity Products.

  • From that roll-up summary field we will come to know number of product’s added to a particular opportunity.

  • Now create a validation rule on the opportunity object. Reference - Validation Rule

  • Criteria: NOT( ISNEW()) && Number_of_Products__c = 0

  • Error Message: Please add at least one product.

promote demote