30 Mar 2019

Color-Code Your Schedule by Status and Resource

Color-Coding by a Second Field

Here’s a beautiful example of adding additional color-coding options and icons to DayBack Calendar. This customer wanted to retain DayBack’s default color-coding for status but add another color–shown here as the header of the event–for color-coding by resource (salesperson, in this case). They also wanted some icons to highlight a few facts about the event. Icons show if the event can be moved or if there is bad weather present.

Color-coding your schedule in DayBack Calendar for Saleforce

Note that if you don’t need a second color, and just want to color-code by resource, you’ll find instructions for doing that here. And while this example adds a second color according to resource, you can base this color on any field in your Salesforce object: just replace Owner.Name below with your field name, remembering to use Name__c if it’s a custom field.

Add A Second Color to Your Calendar

Since you have complete control over DayBack’s CSS, adding these colored headers and icons is pretty easy. For an introduction to editing DayBack’s CSS, look here: customizing the calendar’s appearance. And you’ll find step-by-step instructions for adding icons here: adding styles and colored icons. Like those examples, the implementation above adds some CSS classes to your object’s title field. It then styles those classes by adding some new CSS to the DayBack.

In DayBack’s field mapping, change your “Title” field to this:

It’s wrapping the Subject in the dbkcss with a class of “Owner.Name” that will let us add a specific CSS color for each owner. Now, add the following to DayBack’s CSS where “.Beth.Reynolds” is a resource (salesperson) named “Beth Reynolds”:

Here you’re hard coding each of your resource names into DayBack’s CSS and that works fine if you don’t bring on new resources very often.

Adding Icons

If you’d like to add a single icon, such as a caution icon when an event has the status of “errors”, you’ll find instructions for that here: adding styles and colored icons.

To add the icons we’re using above, you’ll want to add three custom fields that we’re using for these “flags”.

  • DBk_FlagWeather__c (contains “Weather” when true)
  • DBk_FlagUrgent__c (contains “Urgent” when true)
  • DBk_FlagDoNotMove__c (contains “DoNotMove” when true)

These work well as additional fields in DayBack formatted as Radio buttons without titles. Then add the following to the front of your “Title” field in DayBack’s field mapping:

Finally, add this CSS to create colored icons for each flag field that has a value:

That’s it! And remember, if you need help customizing this CSS or adding additional colors, please get in touch. We’re here to help.

Leave a Comment