You need to sign in to do that
Don't have an account?

How do I get a formula field to work when either statement 1 or statement 2 meets the criteria color is red else green?
If either Statement 1 or Statement 2 is true then red, else green
Statement 1
IF(
AND(
Owner.LastName <> "Partners", RecordType.DeveloperName = "Phase 4" ),
OR
Statement 2
IF(
AND(
NOT(ISBLANK(Under_Current_Contract_Until__c)), Under_Current_Contract_Until__c>=TODAY(),
Owner.LastName <> "Partners" ),
IMAGE("/img/samples/color_red.gif", "red", 30, 30),
IMAGE("/img/samples/color_green.gif", "green", 30, 30)
Statement 1
IF(
AND(
Owner.LastName <> "Partners", RecordType.DeveloperName = "Phase 4" ),
OR
Statement 2
IF(
AND(
NOT(ISBLANK(Under_Current_Contract_Until__c)), Under_Current_Contract_Until__c>=TODAY(),
Owner.LastName <> "Partners" ),
IMAGE("/img/samples/color_red.gif", "red", 30, 30),
IMAGE("/img/samples/color_green.gif", "green", 30, 30)
IF(
OR(
AND(
Owner.LastName <> 'Partners',
RecordType.DeveloperName = 'Phase 4'
),
AND(
NOT(ISBLANK(Under_Current_Contract_Until__c)),
Under_Current_Contract_Until__c <= TODAY(),
Owner.LastName <> 'Partners'
)
),
IMAGE('/img/samples/color_red.gif', 'red', 30, 30),
IMAGE('/img/samples/color_green.gif', 'green', 30, 30)
)
All Answers
Try something like this out and let me knwo if it works for you. you might need to modify the result if true and for false.
IF(
OR(
AND(
Owner.LastName <> "Partners",
RecordType.DeveloperName = "Phase 4"
),
AND(
NOT(ISBLANK(Under_Current_Contract_Until__c)),
Under_Current_Contract_Until__c>=TODAY(),
Owner.LastName <> "Partners"
)
),
IMAGE("/img/samples/color_red.gif", "red", 30, 30),
IMAGE("/img/samples/color_green.gif", "green", 30, 30)
)
Hope this helps!
AM
as mentioned above you can try with this way.
Please let me know if this one will help you.
Thanks,
Keyur Modi
Owner.LastName
RecordType.DeveloperName
Under_Current_Contract_Until__c
RecordType.DevelperName = "Phase 4"
Under_Curret_Contract_Until__c : This is the field I am testing the formula by. When I change the field to = today
the color is red. When I change the field to yesterday the field is green. The intent is to have it stay red because if
the first two criterias above are met the status color needs to be red regardless of any other criteria in the rest of the
formula.
IF(
OR(
AND(
Owner.LastName <> 'Partners',
RecordType.DeveloperName = 'Phase 4'
),
AND(
NOT(ISBLANK(Under_Current_Contract_Until__c)),
Under_Current_Contract_Until__c >= TODAY(),
Owner.LastName <> 'Partners'
)
),
IMAGE('/img/samples/color_red.gif', 'red', 30, 30),
IMAGE('/img/samples/color_green.gif', 'green', 30, 30)
)
If still green then check your RecordType.DeveloperName and the comparison for Under_Current_Contract_Until__c.
Hope this helps!
AM
the Under contract until date to yesterday and color was green. When changed to = today it was red.
I appreciate your efforts though. This problem is driving me crazy.
Thanks!
GA
IF(
OR(
AND(
Owner.LastName <> 'Partners',
RecordType.DeveloperName = 'Phase 4'
),
AND(
NOT(ISBLANK(Under_Current_Contract_Until__c)),
Under_Current_Contract_Until__c <= TODAY(),
Owner.LastName <> 'Partners'
)
),
IMAGE('/img/samples/color_red.gif', 'red', 30, 30),
IMAGE('/img/samples/color_green.gif', 'green', 30, 30)
)
works I need to understand why this works.
One other question. Is OR boolean? If it is that doesn't make sense to me and why should your last
suggestion work or even pass a syntax error? I am still trying to adjust from sql statements to this.