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 

validation rule update needed

Hi,

I have this opportunity VR that is working as expected for NEW opportunities so we're good with that piece...;

AND(ISNEW(), TODAY() > DATE(2021,08,28), ISPICKVAL( Type ,'No Contract/Upsell'), ISBLANK(TEXT(NC_U_Reason__c)))

But the intent was also to require NC_U_Reason__c when an existing Opportunity is EDITED as well, AS LONG AS the Created date was after 8/28/21.

Is this possible to do both in the same rule? Can you help with the update to this rule to do both? 

Thanks!



 
Best Answer chosen by Mike A Smith
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Smith,

We can update the same  validation rule as below
 
IF(ISNEW(), AND( TODAY() > DATE(2021,08,28), ISPICKVAL( Type ,'No Contract/Upsell'),
ISBLANK(TEXT(NC_U_Reason__c))), AND ( DATEVALUE(CreatedDate) > DATE(2021,08,28),ISBLANK(TEXT(NC_U_Reason__c) )))

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

Thanks