Setting Calendar Colors According to a field value

Overview

This tutorial visually differentiates calendar entries within Salesforce by assigning specific colors based on field values. You'll learn to create a formula text field that maps various field values to distinct colors, such as event types, project statuses, or any other customizable field. This method enhances the visual appeal and usability of the Avonni Calendar by enabling users to quickly identify different categories of entries through color-coding.

Guided Steps

Step 1: Create a Formula Field for Calendar Color-Coding

We'll create a formula text field. Each option in your 'type' picklist (like 'Meeting' or 'Task') will get its color. The formula will look at the field, see its 'type', and automatically display the right color. Color choices are made using standard web color codes.

Here's a formula example where each type of meeting is associated with a color.

IF(ISPICKVAL(Type__c,'Product Launch'), '#ba0517',
IF(ISPICKVAL(Type__c,'Brand Awareness'), '#d78ff5',
IF(ISPICKVAL(Type__c,'Customer Engagement'), '#fcc003', '#fff000')
)
)

Replace Type__c by the API name of your field

Step 2: Avonni Calendar Configuration

  • Open the Avonni Calendar's Component Builder.

  • Find the "Color" attribute.

  • Change the setting to "Mapped".

  • Select the formula field you created in Step 1 from the dropdown menu.

  • Your calendar entries should now automatically display colors based on your formula

You're done.

Last updated