+ Start a Discussion
Ken sfdc1Ken sfdc1 

Validation on Outcome and shipdate fields not firing as expected

AND( 
RecordTypeId = "012E0000000NA5Q"&& 
(ISPICKVAL( Type__c, "CCM")&& 
ISNULL(Ship_Date__c))&& 

OR(NOT( 
ISPICKVAL(Outcome__c, "Left Message")), 
NOT(ISPICKVAL(Outcome__c,"Unable to Reach")), 
NOT(ISPICKVAL(Outcome__c,"Completed,Patient Started")), 
NOT(ISPICKVAL(Outcome__c,"Completed,Patient has not Started")), 
NOT(ISPICKVAL(Outcome__c,"Not ready for re-order")), 
NOT(ISPICKVAL(Outcome__c,"Patient will call Pharmacy"))))

Ship Date should only be used when Transferred to Pharmacy or Patient Scheduled Delivery are chosen outcomes  

I want a validation for ship date field whenever outcomes are only transferred to Pharmacy or patient Scheduled.It is not working can you help me.
Best Answer chosen by Ken sfdc1
saikrishna.Gsaikrishna.G
IF(IsNULL(ship_Date__c)),ISPICKVAL(Outcome__c,"transferred to Pharmacy")||ISPICKVAL(Outcome__c,"Patient scheduled"),
IF(NOT(ISNULL(Ship_Date__c)),(ISPICKVAL(Outcome__c,"Completed,Patient Started"))||(ISPICKVAL(Outcome__c,"Completed"))||ISPICKVAL(Outcome__c,"Not ready for re-order"))||(ISPICKVAL(Outcome__c,"Patient will call Pharmacy")),
False))

Here First IF Condition will Fire when Ship date is NULL and OUTCOME is transferred to Pharmacy OR Patient scheduled
and second IF Condition will fire when Ship date is NOT NULL and OUTCOME are Completed,Not ready for re-order,Patient will call Pharmacy

All Answers

saikrishna.Gsaikrishna.G

I hope you are looking for this :
IF(NOT(ISNULL(Ship_Date__c)),
    NOT(ISPICKVAL(Outcome__c,"Patient will call Pharmacy")||
    NOT(ISPICKVAL(Outcome__c,"Patient Scheduled Delivery")),
    False)

)
Ken sfdc1Ken sfdc1
So I want it to fire when ship date is null and out comes are transferred to Pharmacy or Patient scheduled.
2. It must fire even when ship date is not null for outcomes all other options like left message,unable to reach etc.
saikrishna.Gsaikrishna.G
IF(IsNULL(ship_Date__c)),ISPICKVAL(Outcome__c,"transferred to Pharmacy")||ISPICKVAL(Outcome__c,"Patient scheduled"),
IF(NOT(ISNULL(Ship_Date__c)),(ISPICKVAL(Outcome__c,"Completed,Patient Started"))||(ISPICKVAL(Outcome__c,"Completed"))||ISPICKVAL(Outcome__c,"Not ready for re-order"))||(ISPICKVAL(Outcome__c,"Patient will call Pharmacy")),
False))

Here First IF Condition will Fire when Ship date is NULL and OUTCOME is transferred to Pharmacy OR Patient scheduled
and second IF Condition will fire when Ship date is NOT NULL and OUTCOME are Completed,Not ready for re-order,Patient will call Pharmacy
This was selected as the best answer