CSM 10.4 Documentation

Home

Change Field Color Based on Value Script

The Change Field Color Based on Value script can be used to set the color of a Field show on the Detail band, including related Fields. For example, you can create a Change Field Color Based on Value script that changes the Field color to orange so that Incidents with an In Progress status stand out.

Change Field Color Based on Value Script Example

Good to know:

  • This script is only available for Fields in the Detail Report band. It is not available for Fields in a Detail Report (example: This script is unavailable for a Detail Report on Journals owned by a particular Incident; the script can only be run on the Detail band, meaning it can only be run for the main Incident, not the Incident's Supporting Objects).
  • Added scripts can be viewed in the Scripts tab.

To add a script to a Report using the Script Wizard:

  1. Open a Report in the Report Designer.
  2. In the Action toolbar, click the Scripts button.

    The Script Wizard opens.

  3. Select the script, and then click Next.

    The Change Field Color Based on Value properties window opens.

  4. Define the following properties:
    1. Band: The band of the Report housing the Field to run the script on (example: Detail_band is the default Detail band available for this script).
    2. Control name: The Field that the script runs on (example: Col4_Status is the Incident Status field).

      Beneath the Control Name drop-down, the Bound Field is described according to the control selected. For example, if the control is Col4_Status, the bound Field is Incident.Status, meaning the Status field is the one that the script runs on.

  5. Click Add to add a Field to the Values list.

    The Colors Based on Field Value window opens.

  6. Select an Operator for the Field:
    • Empty: Finds all instances in the Report where the Field value is empty.
    • Equals: Finds all instances in the Report where the Field value equals the selected value.
    • Like: Finds all instances in the Report where the Field value matches the selected value and its wildcard (example: Jo% finds Joe, John, Jonathan, etc.).
    • Not empty: Finds all instances in the Report where the Field value is not empty.
    • Not equal: Finds all instances in the Report where the Field value does not equal the selected value.
    • Not like: Finds all instances in the Report where the Field value does not match the selected value or its wildcards.
  7. Define the value (example: "Status" Equals "In Progress").
  8. Select a Text color.
  9. Select a Background color.
  10. Select OK.

  11. In the Script Wizard, click Finish.

Was this article useful?