You need to sign in to do that
Don't have an account?
Abhi Malik
Please Help For This validation
Duration and Enddate both are not null at same time , and if both are provied a value then the value of both is equal then only record will be saved. otherwise through an error.
the null part is done like this( ISBLANK( Duration__c )&& ISBLANK( End_Date__c ) ) but how to check the value of duration and enddate.
the null part is done like this( ISBLANK( Duration__c )&& ISBLANK( End_Date__c ) ) but how to check the value of duration and enddate.
OR(ISBLANK( Duration__c )&& ISBLANK( End_Date__c ),
((Month(End_Date__c ) - Month(Start_Date__c )) <> Duration__c ))
All Answers
Validation rule should be as :
OR(ISBLANK( Duration__c ) && ISBLANK( End_Date__c ), Duration__c != End_Date__c )
If this works for you then let me know.
Regards,
Sailee
but its not working throwing an Error: Incorrect parameter type for operator '<>'. Expected Number, received Date, because duration is a number field and enddate is a date field , but if i want the duration then i need to subtract startdate from enddate.
OR(ISBLANK( Duration__c )&& ISBLANK( End_Date__c ),
((Month(End_Date__c ) - Month(Start_Date__c )) <> Duration__c ))
Which type of duration field u have? If it is of number type try this:
OR(ISBLANK( Duration__c ) && ISBLANK( End_Date__c ), Duration__c != Month(End_Date__c) - Month(Start_Date__c) )
If it works, please let me know.
Thanks
Ankur Saini
http://mirketa.com