
I need to create a validation rule that prevents users from adding products to an Opportunity if the Contract Terms are not chosen.
I started with the formula below but the HasOpportunityLineItem doesn't work.
Any suggestions?
AND(
ISBLANK(Opportunity.Contract_Term_Number__c),
NOT(HasOpportunityLineItem))
9 Antworten
You can create a Validation Rule on the Opportunity Product Object and it would be ideal for this use case.
If want the validation rule to be enforced on all existing Opportunity Products so that you can have the Contract Number populated whereever it is blank, use the below Validation Rule.
AND(
ISBLANK(Opportunity.Contract_Term_Number__c)
)
If want the validation rule to be enforced on the new Opportunity Products that will shall be created, use the below Validation Rule.
AND(
ISBLANK(Opportunity.Contract_Term_Number__c),
ISNEW()
)