function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AceldamaAceldama 

Combining two WF into one

Hello!  I have two WF that trigger the same Email Alert notifying our support team when a new Critical case is created during the weekend and after hours.   I now have a 3rd requirement and don't want to increase the noise be introducing a 3rd WF email alert.  I'm trying to combine these into a single formula WF:

 

First WF:  Rule Criteria = (Case: Hour CreatedEQUALS0,1,2,3,4,5,17,18,19,20,21,22,23,24) AND (Case: PriorityEQUALSCritical)

2nd WF:  Rule Criteria = (Case: Case Creation DayEQUALSSaturday,Sunday) AND (Case: PriorityEQUALSCritical)

3rd WF (new):  This new WF will need fire off when a Critical case is created during a Company Holiday:

 

Here is the formula that I worked up, but it keeps telling me I'm missing a ")" somewhere:

 

IF(AND(ISPICKVAL(Priority,"Critical"),
OR (Hour_Created__c,"0",
Hour_Created__c,"1",
Hour_Created__c,"2",
Hour_Created__c,"3",
Hour_Created__c,"4",
Hour_Created__c,"5",
Hour_Created__c,"17",
Hour_Created__c,"18",
Hour_Created__c,"19",
Hour_Created__c,"20",
Hour_Created__c,"21",
Hour_Created__c,"22",
Hour_Created__c,"23",
Hour_Created__c,"24"))),True,

 

IF(AND(ISPICKVAL(Priority,"Critical"),
OR (Case_Creation_Day__c,"Saturday",
Case_Creation_Day__c,"Sunday"))), True,

 

IF(AND(ISPICKVAL(Priority,"Critical"),
OR (CreatedDate ,"2013,09,2",
CreatedDate ,"2013,11,28",
CreatedDate ,"2013,11,29",
CreatedDate ,"2013,12,24",
CreatedDate ,"2013,12,25",
CreatedDate ,"2014,01,01"))),True,False))

 

Best Answer chosen by Admin (Salesforce Developers) 
gautam_singhgautam_singh

Hi,

 

 

Try this formula , I have successfully testesd this in my Developer Org, I believe that it should work in your's. Mark it as a solution if this works correctly or let me know if you face trouble in this again.

 

 

	IF( (AND((ISPICKVAL(Priority,"High")),
(OR(
(gautamsingh__Hours_Created__c== 0), (gautamsingh__Hours_Created__c== 1), (gautamsingh__Hours_Created__c== 2),
(gautamsingh__Hours_Created__c== 4),
(gautamsingh__Hours_Created__c== 5), (gautamsingh__Hours_Created__c== 6), (gautamsingh__Hours_Created__c== 7),
(gautamsingh__Hours_Created__c== 8),
(gautamsingh__Hours_Created__c== 9), (gautamsingh__Hours_Created__c== 10), (gautamsingh__Hours_Created__c== 11),
(gautamsingh__Hours_Created__c== 12),
(gautamsingh__Hours_Created__c== 13), (gautamsingh__Hours_Created__c== 14), (gautamsingh__Hours_Created__c== 15),
(gautamsingh__Hours_Created__c== 16),
(gautamsingh__Hours_Created__c== 17), (gautamsingh__Hours_Created__c== 18), (gautamsingh__Hours_Created__c== 19),
(gautamsingh__Hours_Created__c== 20),
(gautamsingh__Hours_Created__c== 21), (gautamsingh__Hours_Created__c== 22), (gautamsingh__Hours_Created__c== 23),
(gautamsingh__Hours_Created__c== 24)))
) ) , True,
(IF( (AND((ISPICKVAL(Priority,"High")),
(OR(
( gautamsingh__Case_Creation_Day__c == "Sunday"),
( gautamsingh__Case_Creation_Day__c == "Saturday")))
)),True,(
IF( (AND((ISPICKVAL(Priority,"High")),
(OR(
(DATEVALUE(CreatedDate)== DATE(2013,11,28)),
(DATEVALUE(CreatedDate)== DATE(2013,11,29)),
(DATEVALUE(CreatedDate)== DATE(2013,12,24)),
(DATEVALUE(CreatedDate)== DATE(2013,12,25)),
(DATEVALUE(CreatedDate)== DATE(2014,01,01)),
(DATEVALUE(CreatedDate)== DATE(2013,09,2))
))
) ),True,False)))
))

 

Important :

Click on the Star Icon aside if this post provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.

Thank You