---
title: "How to modify the data or style in an Appointment block in the FieldBuddy Dispatch Panel V2?"
canonical: "https://help.fieldbuddy.com/space/FBDOCS/5242650667/How+to+modify+the+data+or+style+in+an+Appointment+block+in+the+FieldBuddy+Dispatch+Panel+V2%3F"
format: markdown
---
> Macro (toc)

## 📜 Customisable Blocks

You might have noticed that some blocks might be styled differently than other ones in the schedule. For example:

![image-20240905-151702.png](media://9ac17cf5-bca0-4c8b-8c1c-1ba2cfca3c9e)

 You can adjust these styles or create new ones. Below is a short guide on how to do it.

## ⚙️ Detailed Explanation

> ℹ️ There is also a document for version 1 of Dispatch Panel, created by @Stefan Schellings (Unlicensed) : [https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/4904550407](https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/4904550407)

### How it works

Every single data entry in the Dispatch Panel has a Salesforce object behind it. See the following example:

![image-20240905-152104.png](media://4d6c13e0-7acd-426a-ba73-650b019ac30b)

Every single Appointment is a Resource Assignment record (api name `FIELDBUDDY__Resource_Assignment__c`) and inside it are the following fields:

- Link to a Resource  (`FIELDBUDDY__Resource2__c`)
- Link to a Work Order (`FIELDBUDDY__Work_Order__c`) or an Absence (`FIELDBUDDY__Absence__c`)
- Start time and End time (`FIELDBUDDY__Start_Time__c` and `FIELDBUDDY__End_Time__c`)
- DP Row 1 and DP Row 2 fields (`DP_Row_1__c` and `DP_Row_2__c`)
- DP Style (`DP_Style__c`)

`DP_Row_1__c`, `DP_Row_2__c` and `DP_Style__c` fields are not present by default but must be manually created as text formulas.

Example of a formula for DP Row 1/2:

```
IF(
  FIELDBUDDY__Absence__c != null,
  "<b>" +(FIELDBUDDY__Absence__r.Name) + "</b>",
  "<i class=\"fa " + DP_Work_Order_Type_Icon__c + "\"></i> "
  + "<b>" + FIELDBUDDY__Work_Order__r.Name + "</b>"
  +" <br/>"
  + " <b>" +(FIELDBUDDY__Work_Order__r.Account_Name__c) + "</b> : " 
  + DP_Location_Address__c 
  + "<br/>" 
  + FIELDBUDDY__Work_Order__r.FIELDBUDDY__Service_Request__r.FIELDBUDDY__Installed_Product__r.FIELDBUDDY__Sub_location__r.FIELDBUDDY__Description__c
)
```

If the DP Row 1 field is not found, the appointments will default into showing the Work Order name and type in the first row of the appointment block.

Example of a formula for DP Style:

```
IF( 
    FIELDBUDDY__Absence__c != null,
    LOWER(FIELDBUDDY__Absence__r.Name),
    CASE(FIELDBUDDY__Work_Order__r.FIELDBUDDY__Type__c,
        "INSTALLATION", "orange",
        "INSPECTION", "blue",
        "CORRECTIVE MAINTENANCE", "purple",
        "INCIDENT", "red",
        "REMOVAL", "darkblue",
        "OVERHAUL", "gray",
        "MAINTENANCE", "yellow",
        "PREVENTIVE MAINTENANCE", "green",
        ""
    )
)
+ IF ( ISPICKVAL( FIELDBUDDY__Work_Order__r.FIELDBUDDY__Status__c, "CLOSED"), " closed", "")
+ IF ( ISPICKVAL( FIELDBUDDY__Work_Order__r.FIELDBUDDY__Status__c, "IN_PROGRESS") , " inprogress", "")
```

The resulting string from the DP Style formula is applied to the appointment blocks as CSS classes.

What is CSS? It is a style sheet language that allows changing the user interface of all elements displayed on the web. Nice explanation and even playground is here - [https://www.w3schools.com/css/css_intro.asp](https://www.w3schools.com/css/css_intro.asp) 

In simple words, CSS describes selectors that point certain elements on the web page and contains rules that change the properties of these elements, like color, position, size, fonts, etc.

Custom CSS styles can be written and applied to these appointments with a Static Resource called DPCSS:

![image-20240905-152420.png](media://ba65f0ff-3159-4906-a23f-7528acdf1747)

In this file, define selectors and rules to apply to the Dispatch Panel. To see an example and more information on how to write this file see [https://help.fieldbuddy.com/space/FBDOCS/6127321094/Dispatch+Panel+Styling](https://help.fieldbuddy.com/space/FBDOCS/6127321094/Dispatch+Panel+Styling) 

Which rules are applied is determined by the DP Style formula. For example, if the related work order to the appointment is not an absence (`FIELDBUDDY__Absence__c` is null), has type of `INCIDENT` and status `IN PROGRESS`, then the applied styles would be `green inprogress`. Therefore the color and border would be impacted.

![image-20260204-145634.png](media://3e3a0178-c456-4e9c-bd8f-f727d63fadcc)

### Steps to change style

1. Think about what you want to change – is the color supposed to be for a particular type or a related account?
  - For example: for all high priority work orders, the color needs to be red and for everything else blue.
2. Check the existing available stylings in the DPCSS Static Resource. You can go to **Setup > Custom Code > Static Resources**, pick DPCSS and download it. If there isn’t a DPCSS static resource yet, create one based on the example here:  [https://help.fieldbuddy.com/space/FBDOCS/6127321094/Dispatch+Panel+Styling](https://help.fieldbuddy.com/space/FBDOCS/6127321094/Dispatch+Panel+Styling)
3. Check the existing formula DP_Style__c on the Resource Assignment object.
4. Adjust the formula to reflect your changes.
  - Example:
5. Adjust DPCSS.css to contain your styles. You can freely add more styles to it.
  - For example:
6. Update your static resource. Click Update and upload the new file.
7. Check if the Dispatch Panel looks as expected.

### Hints

- Always backup your DP_Style formulas and your DPCSS static resource before making any changes. In case of any typos/mistakes – you can revert it back.
- You can add the DP Style property to the page layout or list view of Resource Assignments. That will help checking if formula evaluates to what it is expected to be.
- Be as specific as possible to make sure your css is applied properly. Combine these selectors together without spaces to apply to the specific part of the event you want to affect. See [https://help.fieldbuddy.com/space/FBDOCS/6127321094/Dispatch+Panel+Styling](https://help.fieldbuddy.com/space/FBDOCS/6127321094/Dispatch+Panel+Styling) for more information.
- You can use your browser’s “Inspect” tool to see why your style is not being applied as expected.
  - [https://developer.chrome.com/docs/devtools/inspect-mode](https://developer.chrome.com/docs/devtools/inspect-mode)

### I have no time, please just explain this in 4 sentences

Every appointment is a Resource Assignment (`FIELDBUDDY__Resource_Assignment__c`) record with a link to a Resource and a Work Order. There is a custom unmanaged formula field with the name DP_Style__c. The value of that field is then applied as a CSS class to each block. Custom styles for these CSS classes are defined in a Static Resource named DPCSS.

## 🔗 Useful links

- More about Formula fields in salesforce
  - [https://trailhead.salesforce.com/content/learn/modules/point_click_business_logic/formula_fields](https://trailhead.salesforce.com/content/learn/modules/point_click_business_logic/formula_fields)
- Getting started with CSS
  - [https://www.w3schools.com/css/css_intro.asp](https://www.w3schools.com/css/css_intro.asp)
  - [https://developer.mozilla.org/en-US/docs/Learn/CSS/First_steps/Getting_started](https://developer.mozilla.org/en-US/docs/Learn/CSS/First_steps/Getting_started)
- How to use Chrome Dev Tools to inspect style
  - [https://developer.chrome.com/docs/devtools/inspect-mode](https://developer.chrome.com/docs/devtools/inspect-mode)

## \uD83D\uDCCB Related articles



> Macro (contentbylabel)