Adding an FSM Schedule Board Case Type Filter
This example filters CRM tasks by the selected Case Types. It retains project tasks, Employee Non-Working Days, and Resource Allocations regardless of that selection. It uses a separate mapped property, casetypefilter, so that the filtering values don't alter the existing casetype property used for coloring.
The following table shows the value supplied by each event definition and the effect of selecting Case Types.
|
Event Definition |
Value Supplied to |
Effect of Selecting Case Types |
|---|---|---|
|
|
The linked case's Case Type ID. |
Matches the selected types. CRM tasks with no Case Type don't match an active selection. |
|
|
An array containing every available Case Type ID. |
Matches any selected type without reading a case field from the project task. |
|
|
The same array of Case Type IDs. |
Retains blocks for nonworking days without requiring a case relationship. |
|
|
The same array of Case Type IDs. |
Retains allocation blocks without requiring a case relationship. |
The following fragment assumes Project Management and Resource Allocations are enabled. If Project Management is disabled, omit the complete projecttask override. If either required feature is disabled, omit the complete resourceallocation override. Extend only the existing enabled definitions. A partial map is not a new event definition.
Add these properties to the existing custom configuration. The two panels use the same option search. Each retained context event resolves that search to an array of IDs using map: "internalid", rather than to option objects.
{
"routes/scheduler": {
"event": {
"task": {
"map": {
"casetypefilter": "case.custevent_nx_case_type|"
}
},
"projecttask": {
"map": {
"casetypefilter": {
"record": "customrecord_nx_case_type",
"all": true,
"map": "internalid"
}
}
},
"nonworkingday": {
"map": {
"casetypefilter": {
"record": "customrecord_nx_case_type",
"all": true,
"map": "internalid"
}
}
},
"resourceallocation": {
"map": {
"casetypefilter": {
"record": "customrecord_nx_case_type",
"all": true,
"map": "internalid"
}
}
}
},
"assignedpanel": {
"filter": {
"casetype": {
"label": "Case Type",
"column": "casetypefilter",
"options": {
"record": "customrecord_nx_case_type",
"all": true,
"map": {
"id": "internalid",
"label": "name"
}
},
"allany": false
}
}
},
"unassignedpanel": {
"filter": {
"casetype": {
"label": "Case Type",
"column": "casetypefilter",
"options": {
"record": "customrecord_nx_case_type",
"all": true,
"map": {
"id": "internalid",
"label": "name"
}
},
"allany": false
}
}
}
}
}
Use Any matching when selecting several Case Types: a CRM task has one linked Case Type. allany: false omits the All/Any control for this filter. It doesn't reset a previously saved All mode. The panel's Clear All action removes its selected filters and their matching modes.
The all-ID arrays are matching values for presentation and don't assign every Case Type to those records. Keep their search criteria aligned with the option search if you later restrict the available Case Types. An empty value, an absent property, or an arbitrary value such as "all" doesn't provide this behavior. The ID array is returned with each retained event, so its size grows with the Case Type list.
Retained events still have to satisfy the underlying searches, date range, visible resource rows, other active filters, and text search. For example, a resource-panel filter can remove an employee row and its blocks for nonworking days. This example prevents the Case Type filter from excluding context events. Other board filters can still exclude those events.
If other event definitions are displayed, give each one a deliberate mapping. Use its real Case Type where that relationship is supported, or the all-ID array where the event definition should remain visible. If a criterion applies to CRM tasks and project tasks but not to nonworking days, map the corresponding field separately for each task type. Use the all-option-ID pattern only for context records that you intend to retain.