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
Phillip Moseley 10Phillip Moseley 10 

Images are not showing in Formula field. Value be entered into field based off Formula below is N/A

Hello,
In the formula below, I would like the outcome of the Formula to enter the correct image into the Deal Approval Required field. Green, Blue, Yellow, etc. The first part of the formula is working as expected, so Approval Not Required is being entered if amount >7500 is working, but rest of the formula is not working correctly. Any ideas or suggestions would be appreciated. Thanks.  

IF(
    SBQQ__NetAmount__c > 7500, 
    "Approval Not Required",
    IF(
        SBQQ__NetAmount__c <= 7500 && ISBLANK(CPQ_Approval_Level_MAX__c), 
        "Approval Required ",
        CASE(
    CPQ_Approval_Level_MAX__c,
    1, IMAGE('https://jmpsoftware--main2--c.documentforce.com/servlet/servlet.ImageServer?id=0155b000006hl9z&oid=00D8K0000004cJ1&lastMod=1652276904000', "Green"),
    2, IMAGE('https://jmpsoftware--main2--c.documentforce.com/servlet/servlet.ImageServer?id=0158K0000000Xrs&oid=00D8K0000004cJ1&lastMod=1652276872000', 'Blue'),
    3, IMAGE('https://jmpsoftware--main2--c.documentforce.com/servlet/servlet.ImageServer?id=0155b000006hl9y&oid=00D8K0000004cJ1&lastMod=1652276772000', 'Yellow'),
    4, IMAGE('https://jmpsoftware--main2--c.documentforce.com/servlet/servlet.ImageServer?id=0155b000006hlA0&oid=00D8K0000004cJ1&lastMod=1652276863000', 'Red'),
    5, IMAGE('https://jmpsoftware--main2--c.documentforce.com/servlet/servlet.ImageServer?id=0155b000006hl9x&oid=00D8K0000004cJ1&lastMod=1652290642000', 'Black'),
    "N/A"
)
    )
)
Best Answer chosen by Phillip Moseley 10
Arun Kumar 1141Arun Kumar 1141

Hi Phillip,

I have checked the above formula by creating a formula field in the Account object and it is working perfectly. Url for the case with CPQ_Approval_Level_MAX__c value equal to 2 is working while another URL where CPQ_Approval_Level_MAX__c field value is 1,3,4 or 5 are not public that's why it is not showing in the field. I have attached screenshots of the field showing the image. You can make the URL public and then try again.

User-added image

If only the first condition is working where SBQQ__NetAmount__c is greater than 7500, even if SBQQ__NetAmount__c is less than 7500, then check the data type of field inserted in the formula or return type of formula field correctly. Also, check Blank Field Handling that blank fields are treated as blanks, not zeros. If it is treated as zeros, then the second condition criteria will not met.

User-added image                                                              Url of Case where CPQ_Approval_Level_MAX__c = 2                                                         


  For Url Other than CPQ_Approval_Level_MAX__c = 2

Please mark it as best answer if it helps.

Thanks,

All Answers

SwethaSwetha (Salesforce Developers) 
HI,

When you say the "rest of the formula is not working correctly," can you provide more details on how it's not working as expected? Are there any error messages or issues you're encountering?

Also, what is the data type of the "Deal Approval Required" field where you are trying to display images? Is it a formula field of type "Text" or "Image"?

Thanks
Arun Kumar 1141Arun Kumar 1141

Hi Phillip,

I have checked the above formula by creating a formula field in the Account object and it is working perfectly. Url for the case with CPQ_Approval_Level_MAX__c value equal to 2 is working while another URL where CPQ_Approval_Level_MAX__c field value is 1,3,4 or 5 are not public that's why it is not showing in the field. I have attached screenshots of the field showing the image. You can make the URL public and then try again.

User-added image

If only the first condition is working where SBQQ__NetAmount__c is greater than 7500, even if SBQQ__NetAmount__c is less than 7500, then check the data type of field inserted in the formula or return type of formula field correctly. Also, check Blank Field Handling that blank fields are treated as blanks, not zeros. If it is treated as zeros, then the second condition criteria will not met.

User-added image                                                              Url of Case where CPQ_Approval_Level_MAX__c = 2                                                         


  For Url Other than CPQ_Approval_Level_MAX__c = 2

Please mark it as best answer if it helps.

Thanks,

This was selected as the best answer
Phillip Moseley 10Phillip Moseley 10
Hi Arun, thanks for the help here. It ended up being the Blank Field Handling that blank fields are treated as blanks, not zeros that needed to be updated. Once I changed this for the fields to be treated as blanks instead of zeros, the images started appearing. Thanks again!