Print this page

#Error When Concatenating Multiple Images in a Single Formula Field

Knowledge Article Number 000239344

Users are able to display Images in formula fields by utilizing the IMAGE() function. It is possible to concatenate multiple images by using the concatenate operator (& or +) and multiple uses of the IMAGE() function. For example, you can display 2 images as follows (the following example formula will display the same image twice, but you can modify this to display different images as well):

IMAGE("/servlet/servlet.ImageServer?id=01537000000gdCv&oid=00D37000000JT6n&lastMod=1463432957000","GoodWillHunting",50,50) + " "+ 

This process can be extended to display many images in the same field. Even though you may be under the Formula Compile Size Limit, you may run into a scenario when your formula will display #Error instead of the images. This can happen in the following scenarios:

  • You are using a lot of images (9 images will work, 10 will not)
  • You are using very large images
  • Your formula logic has a calculation error (dividing by 0, for example)
  • Any combination of the above

This is expected behavior, but there are a couple of ways in which you can alleviate this issue:
If the issue is that your images are too large, you can try scaling them down before uploading them as a Salesforce Document.

If the issue is that you are using too many images, consider consolidating a few of the image into a single image, so that you are concatenating fewer images into the field.

You have 4 images that may or may not be displayed simultaneously based on the owner of a particular Case.
You have 3 more images that may or may not be displayed simultaneously based on the age of that particular Case.
You have 3 images that may or may not be displayed simultaneously based on the details of the Case contact.
You would like all of these images in a single field at the top of your Case record as a Banner, but are getting #Error because you are using 10 images in a single field.

Take any group of images from above (the smaller the group, the better). For example, let's take the images based on the details of the Case Contact, and call them A, B, and C.
Each image A, B, or C can either be displayed, or not displayed based on your formula logic. Since there are 2 options (on or off), and 3 images, there are 8 possible combinations of images.
ABC, AB, AC, BC, A, B, C, All Off.
Instead of using your 3 original images, create 8 different images for each of the combinations above and incorporate them into your formula logic. By doing this, the maximum number of images that you will be displaying in your formula goes from 10 (4+3+3) to 8 (4+3+1), which should allow you to display the images without #Error.

promote demote