You need to sign in to do that
Don't have an account?
Mike A Smith
validation rule issue upon edit
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:
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:
- Create new No Contract/Upsell Opportunity, set NC/U reason to anything
- Edit Opportunity Type to something other than No Contract/Upsell. Save.
- Attempt to change NC/U Reason to “None” – error results.
Thanks for confirmation. Please update the validation rule as below.
If this solution helps, Please mark it as best answer.
Thanks,
All Answers
As per the validation rules , If we are editing a opportunity and saving it with created date >2021,08,28 and NC_U_Reason__c is null the validation rule will fire.
Can you confirm what should be the behaviour while editing an existing record?
Thanks,
As per the validation rule
1) if that is a new opportunity and create date is greater than 28/08/2021 and Type == No Contract/Upsell then NC_U_Reason__c should not be null.
2) If that is exising opportunity and you are editing it such that created date is greater than 2021,08,28 NC_U_Reason__c should not be null.
Let us know what you want to edit the validation rule. How should it behave in case of edit?
Thanks,
Help me if my understanding is correct. In case the user edits the opportunity with type as No Contract/Upsell then only NC_U_Reason__c is required.
NC_U_Reason__c field is not required for other types ?
Thanks,
Thanks for confirmation. Please update the validation rule as below.
If this solution helps, Please mark it as best answer.
Thanks,