2

I'm a total salesforce noob, but I have a background in java and php so I'm looking at this kind of logically and I need some help.

I have a workflow to assign a task when: C

ontact Record Type = 'myorg'
AND
(Email Opt Out = true
OR
bounced = true)
AND
(Stage = apply 
OR
Stage= enrolled
OR
Stage = paid)

currently it's in a "criteria are met" fields with a filter of 1 and (2 or 3) and (4 or 5 or 6)

It doesn't always work correctly and applies the task when 4,5, or 6 are something different, so I'm trying to rewrite it to the "formula evaluates to true" area and I'm not sure if I'm doing it correctly, so far what I have is:

IF(ISPICKVAL( Record_Type__c , 'myOrg'),  
IF( (HasOptedOutOfEmail = true || HasEmailBounced__c = true),
IF( ISPICKVAL(Stage__c, 'Apply')||ISPICKVAL(Stage__c, 'Enroll')||ISPICKVAL(Stage__c, 'Paid') , true
, false) 
, false)
, false )

The syntax checks out, but I feel like there should be some AND() as well as OR() functions in there.

EDIT: Ok so here is my version with AND() and OR() logic included, still not sure if it'll work, I'm a bit nervous to fire it on the org because I don't want hundreds of tasks assigned

AND( ISPICKVAL( Record_Type__c , 'myOrg') , 
OR(HasOptedOutOfEmail = true,HasEmailBounced__c = true) ,
OR(ISPICKVAL(Stage__c, 'Student'),ISPICKVAL(Stage__c, 'Applicant'),ISPICKVAL(Stage__c, 'Deposited') ))

Thank you for looking!

2
  • welcome to salesforce.stackexchange mikesalty, i've taken the liberty to apply code format to the formula bits, this makes it easier to read. In next questions you can do that yourself by using the {} button in the question/answer editor. Mar 4, 2014 at 16:55
  • That's all right, we're here to help. Mar 4, 2014 at 17:01

1 Answer 1

0
IF(
     AND( 
          ISPICKVAL( 
                   Record_Type__c , 'TCGS'
                  ) , 
          OR(
                    HasOptedOutOfEmail , HasEmailBounced__c
            ) ,
          OR(
                  ISPICKVAL(
                             Stage__c, 'Student'
                           ) ,
                  ISPICKVAL(
                             Stage__c, 'Applicant'
                           ) ,
                  ISPICKVAL(
                           Stage__c, 'Deposited'
                           ) 
           )
       ) ,
     true,
     false
)

Now the formula seems correct. But before apply it to test check for all String quoted values once again that they should equal to the picklist value.

I assumed HasOptedOutOfEmail and HasEmailBounced__c as checkbox type fields.

1
  • This seems to be working thank you! So salesforce workflow formula works the same as normal booleans for things like checkboxes and assumes true?
    – mikesalty
    Mar 4, 2014 at 18:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .