+ Start a Discussion
SFDC Apex DevSFDC Apex Dev 

Please help me to correct the validation rule which is on case object .... I want that this validation rule should fire for the new cases only.. how to use isNew() functionality in this .. I stuck... Please help..

AND(NOT(ISBLANK(Component__c)),AND(OR(AND(Component__r.Product__r.yes__c = FALSE,NOT(ISPICKVAL(Component__r.type__c,"exhausted"))),NOT(ISPICKVAL( Component__r.Status__c,"install"))),Service__c = FALSE),$RecordType.Name='supportive', 
$Setup.settings__c.Validate__c = FALSE, 
ISBLANK(source__c),ISPICKVAL(Categories__c,"fields"),OR(ISPICKVAL(Reasons__c,"appear"), ISPICKVAL(Reasons__c,"Maintenance")),NOT(ISPICKVAL(Origin,"Portal")),Component__r.Product__r.source__c = "RT")
$hwet@$hwet@
Hi,

This explanation might be helpful for you:

https://help.salesforce.com/articleView?id=customize_functions_i_z.htm&type=5
https://success.salesforce.com/answers?id=90630000000ghXoAAI
JayantJayant
Try this - 

AND(
ISNEW(),
NOT(ISBLANK(Component__c)),AND(OR(AND(Component__r.Product__r.yes__c = FALSE,NOT(ISPICKVAL(Component__r.type__c,"exhausted"))),NOT(ISPICKVAL( Component__r.Status__c,"install"))),Service__c = FALSE),$RecordType.Name='supportive', 
$Setup.settings__c.Validate__c = FALSE, 
ISBLANK(source__c),ISPICKVAL(Categories__c,"fields"),OR(ISPICKVAL(Reasons__c,"appear"), ISPICKVAL(Reasons__c,"Maintenance")),NOT(ISPICKVAL(Origin,"Portal")),Component__r.Product__r.source__c = "RT"
)

That's it my friend :).
SFDC Apex DevSFDC Apex Dev

Thanks Shweta and Jayant. I got it. I have done it.

But thankyou for your help.

JayantJayant
If you believe any answer helped you, kindly mark it as the Best Answer.  You may also choose to not mark any answer as well if you think the answers were redundant.
Side effects of Gamification :).