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
Chris Federspiel - ic-2000.comChris Federspiel - ic-2000.com 

Two images to display for multiple tests

Hi. I can't figure this out. I want to display two flags if it hits both criteria. What overall enveloping function can carry both of these statements? Or is there another way to do this? - The two if statements below display a flag if the criteria is met. I'm trying to have the field display both flags if both criteria are met instead of having a separate field for each flag. Ideas? IF( OR( AND(ISBLANK(Case__c) ,ISBLANK(Project__c)), AND(time_in_decimal__c>=3, ISBLANK(Project__c))), IMAGE("https://c.na2.content.force.com/servlet/servlet.FileDownload?file=01540000000f3ht","Orange"),null) IF(Review_Needed__c,IMAGE("https://c.na2.content.force.com/servlet/servlet.FileDownload?file=01540000000f3hs","Red"), null)
Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

Oh, you want 2 images in 1 result?   That one might be kinda tough.  You might have to either use Visualforce (which I can't help you with) or create a "combined image" in a Photo Editor and reference that image in your file.  

Or you could try to write your results to 2 sepearate (hidden) fields and then concatenate them in another Formula(Text) field.  

 

I just re-read your first post and saw that you're trying to avoid having a 3rd concatenated field.  

All Answers

Chris Federspiel - ic-2000.comChris Federspiel - ic-2000.com

It posted poorly the first time. Here it is broken out as I read it:

1st Statement

IF( OR( AND(ISBLANK(Case__c) ,ISBLANK(Project__c)), AND(time_in_decimal__c>=3, ISBLANK(Project__c))),

IMAGE("https://c.na2.content.force.com/servlet/servlet.FileDownload?file=01540000000f3ht","Orange"),null)

 

2nd

IF(Review_Needed__c,IMAGE("https://c.na2.content.force.com/servlet/servlet.FileDownload?file=01540000000f3hs","Red"), null)

 

I need 1 and 2 to be in the same formula as my custom field.

Steve :-/Steve :-/

You're almost there, the way that IF functions work your formula needs to be more like

 

 

IF( OR( AND(ISBLANK(Case__c) ,ISBLANK(Project__c)), AND(time_in_decimal__c>=3, ISBLANK(Project__c))),
IMAGE("https://c.na2.content.force.com/servlet/servlet.FileDownload?file=01540000000f3ht","Orange"),
(Review_Needed__c,IMAGE("https://c.na2.content.force.com/servlet/servlet.FileDownload?file=01540000000f3hs","Red"), null)

 

 

Chris Federspiel - ic-2000.comChris Federspiel - ic-2000.com

Interesting. Does it not need a second 'IF'? As-is in the reply, I get "Error: Syntax error. Missing ')'" after the Review variable.

Steve :-/Steve :-/

Sorry, I don't have your custom fields on my SFDC Org, so I had to kinda wing it with the formula.  

 

Try this one

 

IF( OR( AND(ISBLANK(Case__c) ,ISBLANK(Project__c)), AND(time_in_decimal__c>=3,ISBLANK(Project__c))),IMAGE("https://c.na2.content.force.com/servlet/servlet.FileDownload?file=01540000000f3ht","Orange"), IF(Review_Needed__c,IMAGE("https://c.na2.content.force.com/servlet/servlet.FileDownload?file=01540000000f3hs","Red"), null))

 

 

Chris Federspiel - ic-2000.comChris Federspiel - ic-2000.com

Thank you for helping me with this! The syntax was correct and you taught me how to put in both IFs, but it's not working properly. It doesn't put both flags into the field. Is it possible to insert two images into one field?

Steve :-/Steve :-/

Oh, you want 2 images in 1 result?   That one might be kinda tough.  You might have to either use Visualforce (which I can't help you with) or create a "combined image" in a Photo Editor and reference that image in your file.  

Or you could try to write your results to 2 sepearate (hidden) fields and then concatenate them in another Formula(Text) field.  

 

I just re-read your first post and saw that you're trying to avoid having a 3rd concatenated field.  

This was selected as the best answer
Chris Federspiel - ic-2000.comChris Federspiel - ic-2000.com

Thank you. I understand better now.