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
Mike A SmithMike A Smith 

opportunity validation rule needed

Hello, I need to create a validation rule to require a picklist based on a Type value but only for new Opportunities. 

So on any Opportunity with created date = or > 8/28/21 when Type= 'No contract/Upsell' then the 'NC/U Reason' picklist is required .

Can you assist?

 
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Mike,

You can use the below validation rule for the scenerio.
 
AND(DATEVALUE(CreatedDate)> DATE( 2021, 08, 28 ) , ISPICKVAL( Type ,'No contract/Upsell') ,ISBLANK( Text(NC_U_Reason__c) ) )


If this solution helps, Please mark it as best answer.


Thanks,
​​​​​​​K. Sai Praveen kumar.

Suraj Tripathi 47Suraj Tripathi 47

Hi,

Please try this formula.

AND(DATEVALUE(CreatedDate)> DATE( 2021, 08, 28 ) , ISPICKVAL( Type ,'No contract/Upsell') ,ISBLANK( Text(NC_U_Reason__c) ) )

Thank You
AnkaiahAnkaiah (Salesforce Developers) 
Hi Mike,

Need to add extra condition to the above formula to work only for new opporunity creation. use the blow formula.
 
AND(ISNEW(), DATEVALUE(CreatedDate)> DATE( 2021, 08, 28 ) , ISPICKVAL( Type ,'No contract/Upsell') ,ISBLANK( Text(NC_U_Reason__c) ) )

If this works, Please mark it as best answer.

Thanks,
Ankaiah
Mike A SmithMike A Smith
Hi Ankaiah,

I just heard from the requester after I created the VR (and it is active) and she states the below;

"I just checked in UAT. The field itself looks as expected, but there’s nothing requiring the NC/U Reason be completed when I create a new Opportunity with the Type of “No Contract/Upsell” 

Thanks,
Mike