Skip to main content
I have this validation rule below which DOES work as intended (1. require the field for ALL NEW Opportunities. 2. require the field during an edit on existing Opportunities that were created after 8/28/21 );

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) )))

But there is this Error that occurs now on a NEW opportunity, can you tell me how to resolve this? 

Problem: With a newer Opportunity created with Type = No Contract/Upsell and NC/U Reason chosen, if I save and then edit the Type, it does not allow me to remove the NC/U Reason.

Error Shown: still gives the VR error message "If you select 'No Contract/Upsell' in Type then the 'NC/U Reason' field is required"

Steps to reproduce:

  1. Create new No Contract/Upsell Opportunity, set NC/U reason to anything
  2. Edit Opportunity Type to something other than No Contract/Upsell. Save.
  3. Attempt to change NC/U Reason to “None” – error results.

Thanks!

7 个回答
  1. 2021年9月13日 14:42
    Hi Mike ,

    Thanks for confirmation. Please update the 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),ISPICKVAL( Type ,'No Contract/Upsell'),ISBLANK(TEXT(NC_U_Reason__c) )))

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

    Thanks,
0/9000