Adding an FSM Schedule Board Case Type and Context Color Group
This topic includes the following sections:
The following examples show three alternative ways to color CRM tasks by Case Type and provide gray presentation for work without a Case Type. Use the common Case Type group with one alternative. The alternatives are not cumulative.
|
Alternative |
Value of This Approach |
Effect on Existing Event Colors |
|---|---|---|
|
One shared context item |
One label and one color you can customize for all work without a Case Type. |
Gray is a fallback, and populated event-level swatches are retained. |
|
Separate context items |
Each context can later have its own label, color, and map-cluster rank. |
Gray is a fallback, and populated event-level swatches are retained. |
|
Direct swatch mappings |
Fixed gray values with no context items to maintain in the color group. |
Replaces context records' mapped swatches and applies whenever the active group honors event-level swatches. |
The common group uses casecolour for a single category value. Keep it separate from the casetypefilter arrays used to add a Case Type filter. For the arrays, see Adding an FSM Schedule Board Case Type Filter. Case Type items are loaded from their record search. No account-specific IDs are hard-coded.
Include a projecttask override only when Project Management is enabled. Include a resourceallocation override only when Project Management and Resource Allocations are enabled. Merge into the enabled standard definitions, preserving their searches, identity, date, resource, eligibility, and save mappings.
Common Case Type Group
This fragment adds casework and makes it the configuration default. It supplies the CRM task's actual Case Type and the corresponding color items. Add one of the three context-color alternatives to configure the presentation of other work.
{
"routes/scheduler": {
"event": {
"task": {
"map": {
"casecolour": "case.custevent_nx_case_type|"
}
}
},
"colour": {
"default": "casework",
"group": {
"casework": {
"label": "Case Type and Context",
"column": "casecolour",
"palette": "cool",
"items": {
"array": true,
"casetypes": {
"record": "customrecord_nx_case_type",
"all": true,
"map": {
"id": "internalid",
"label": "name",
"cluster": 1
}
}
},
"eventswatch": true
}
}
}
}
}
Case Type items receive colors from Cool in item order, cycling when necessary. A saved user group, palette, or swatch choice can take precedence over configuration defaults.
One Shared Context Item
Use this when all work without a Case Type can share one color choice. CRM tasks without a Case Type, project tasks, nonworking days, and Resource Allocations return otherwork.
{
"routes/scheduler": {
"event": {
"task": {
"map": {
"casecolour": "formulatext:nvl(to_char({case.custevent_nx_case_type.id}), 'otherwork')"
}
},
"projecttask": {
"map": {
"casecolour": "formulatext:'otherwork'"
}
},
"nonworkingday": {
"map": {
"casecolour": "formulatext:'otherwork'"
}
},
"resourceallocation": {
"map": {
"casecolour": "formulatext:'otherwork'"
}
}
},
"colour": {
"group": {
"casework": {
"items": {
"context": [
{
"id": "otherwork",
"label": "Other Work",
"swatch": "battleshipgrey",
"cluster": 2
}
]
}
}
}
}
}
}
The single context item defines the label and fallback color for all four situations. Its ID is an ordinary matching value, not a wildcard. The ID could be named all, but that name would not make it match other values automatically.
eventswatch: true in the common group preserves populated event-level swatches. Completed tasks keep their standard gray color. Tasks linked to closed cases, nonworking days, and Resource Allocations keep their existing specialized presentation. Battleship Gray is used when no event-level swatch is present.
Separate Context Items
Use separate context items to configure each situation independently. The example starts all four items at Battleship Gray, but maps a distinct ID for each one.
{
"routes/scheduler": {
"event": {
"task": {
"map": {
"casecolour": "formulatext:nvl(to_char({case.custevent_nx_case_type.id}), 'nocasetype')"
}
},
"projecttask": {
"map": {
"casecolour": "formulatext:'projecttask'"
}
},
"nonworkingday": {
"map": {
"casecolour": "formulatext:'nonworkingday'"
}
},
"resourceallocation": {
"map": {
"casecolour": "formulatext:'resourceallocation'"
}
}
},
"colour": {
"group": {
"casework": {
"items": {
"context": [
{
"id": "nocasetype",
"label": "No Case Type",
"swatch": "battleshipgrey",
"cluster": 2
},
{
"id": "projecttask",
"label": "Project Task",
"swatch": "battleshipgrey",
"cluster": 2
},
{
"id": "nonworkingday",
"label": "Non-Working Day",
"swatch": "battleshipgrey",
"cluster": 2
},
{
"id": "resourceallocation",
"label": "Resource Allocation",
"swatch": "battleshipgrey",
"cluster": 2
}
]
}
}
}
}
}
}
For example, changing only the projecttask item's swatch to viridiangreen gives project tasks that fallback color. The other three items retain Battleship Gray. The chosen swatch must belong to Cool. You can also customize the items independently when color customization is enabled.
For an example of event-level swatches taking precedence, see One Shared Context Item. Changing the item for nonworking days alone doesn't replace its standard unavailable swatch. Use eventswatch: false only when the group should replace all event-level colors, including completed-task and specialized context presentation.
Direct Swatch Mappings
Use this alternative when the gray context color should be fixed in the event mappings. Add this fragment to the common Case Type group configuration without adding either context-item alternative:
{
"routes/scheduler": {
"event": {
"task": {
"map": {
"swatch": "formulatext:case when {status.id} like 'COMPLETE' then 'ashgray' when {status.id} not like 'COMPLETE' and {case.stage} like 'CLOSED' then 'inactive' when {case.custevent_nx_case_type.id} is null then 'battleshipgrey' end",
"cluster": 2
}
},
"projecttask": {
"map": {
"swatch": "formulatext:'battleshipgrey'",
"cluster": 2
}
},
"nonworkingday": {
"map": {
"swatch": "formulatext:'battleshipgrey'",
"cluster": 2
}
},
"resourceallocation": {
"map": {
"swatch": "formulatext:'battleshipgrey'",
"cluster": 2
}
}
}
}
}
Here, swatch contains the recognized color name directly. casecolour still identifies a Case Type item. Putting a color name into casecolour alone would not assign that color.
The CRM task formula retains the standard completed-task and closed-case colors, then returns Battleship Gray when there is no Case Type. Ordinary CRM tasks with a Case Type receive their group color.
The other three maps replace their inherited swatches with Battleship Gray. This also replaces completed project tasks' standard gray color, the presentation for nonworking days, and Resource Allocations' hard/soft color distinction. Their dates, calendar effects, eligibility, and save behavior are unchanged.
With eventswatch: true, the direct swatch takes precedence over group and palette choices. It therefore remains fixed when the user changes to another group that also honors event-level swatches. With eventswatch: false, the active group ignores it. You cannot recolor these context records through a context item because this alternative defines none.
This alternative requires at least one available Case Type item for the new group. If there are no Case Types, use an existing enabled color group for the direct swatches instead.
The direct cluster: 2 mapping gives those events an explicit map-cluster rank. When an ordinary CRM task receives its Case Type group color, the item's rank of 1 is applied instead.
All three alternatives color available events without adding panel filters or changing which records the searches retrieve.