Friday, February 15, 2019

Use a Custom Field to Contain Different Indicator Images Based on the Value of another Field

To use a custom field to contain different indicator images based on the value of another field. We can use a custom field of type inline html and use the URL field of the image uploaded on an <IMG> tag.

Below is a sample use case.

User would like to show a Red, Yellow or Green dot as indicator of the level already achieved for "Estimated Gross Profit Percent" field under the Financial tab of a Project Record. They would like to show a Red dot if value is 20% or lower, Yellow dot if value is between 20% and 50% and Green if 80% or higher.

Steps:
1. Upload Images of Red, Yellow and Green dot in File Cabinet. (Documents> Files> File Cabinet)
2. Edit the image file and make sure Available Without Login is checked. Also, take note of the URL.
3. Create a custom entity field. (Customization>Lists, Records, & Fields> Entity Fields> New)

  • Label - Estimated Gross Profit Percent Image
  • Type - Inline HTML
  • Applies To > Project - Checked
  • Validation & Defaulting > Default Value :

CASE

WHEN ({estimatedgrossprofitpercent}<=.2) THEN '<IMG src="URL for red dot indicator" height="42" width="42" />'

WHEN ({estimatedgrossprofitpercent}<=.5 AND {estimatedgrossprofitpercent}>.2) THEN '<IMG src="URL for yellow dot indicator" height="42" width="42" />'

WHEN ({estimatedgrossprofitpercent}>.5) THEN '<IMG src="URL for green dot indicator" height="42" width="42" />'

END

No comments:

Post a Comment