+ Start a Discussion
Steven YongSteven Yong 

Simple validation rule for opportunity page


I would like to have a validation rule when a opportunity have product added that proposal got to have contact as well.
SonamSonam (Salesforce Developers) 
So are you saying that you wish to check the Account related to the opportunity has contact associated to it? is that what the requirement is?

Hi Steven,
I'd suggest you create a rollup formula to keep the count of opportunitylineitem. Once you have that, in your validation rule, you could say:

if(oppRollup__c > 0 && contact__c == null, true, false)

//Assuming that you have a contact field


Steven YongSteven Yong
Hi Sonam & justin_sfdc

I mean to say the contact role under opportunity page related list. Sorry for the confusion.