TTMSFNCFilterRule Class
Represents one filter rule that evaluates a filter expression against items resolved from a source component and applies property assignments based on the match result.
API unit family: TMS.TMSFNCFilterRulesManager
Inherits from: TCollectionItem
Syntax
TTMSFNCFilterRule = class(TCollectionItem)
Remarks
Set Source to the root component, ItemsPath to the RTTI path that resolves the target collection or item (for example Items[*]), and FilterText to a filter expression (for example "Text" LIKE 'B%'). Leave FilterText empty to match all items unconditionally. When Active is False, InactiveValue from each action is applied instead of running the filter. All fluent helpers return Self so configuration calls can be chained.
Properties
| Name | Description |
|---|---|
| Actions | Collection of property assignments applied to each item based on the match, no-match, or inactive state. |
| Active | When True (default), the filter expression is evaluated and match/no-match actions are applied; when False, inactive-value actions are applied and Apply is called immediately on assignment. |
| FieldTypes | Collection of explicit data-type overrides for named filter fields; entries survive each Apply call. |
| FilterBuilder | Provides direct access to the internal filter builder for advanced format or column configuration that must survive across Apply calls. |
| FilterText | Filter expression evaluated by the internal filter builder (for example "Text" LIKE 'B%'); leave empty to match all items unconditionally. |
| ItemsPath | RTTI path resolved on Source to locate the item or item collection to evaluate (for example Items[*] or Items[1..3\|5]); leave empty to apply the rule to Source itself. |
| Name | Identifier for the rule; used by GetRuleByName and ApplyActiveRules pattern matching. |
| Source | Root component that the RTTI path resolver navigates from when resolving ItemsPath. |
Methods
| Name | Description |
|---|---|
| AddDisableAction | Adds a disable action: Enabled=False on match, Enabled=True on no-match; returns Self for chaining. |
| AddEnableAction | Adds an Enabled action: True on match, False on no-match; returns Self for chaining. |
| AddVisibilityAction | Adds a Visible action: True on match, False on no-match; returns Self for chaining. |
| Apply | Applies the rule according to its current Active state, writing property values to each resolved item. |
| ApplyInactive | Pushes inactive-value actions to every item regardless of Active; useful for preview or reset scenarios without changing the Active flag. |
| Clear | Deactivates the rule and clears all actions and field-type overrides; returns Self for chaining. |
| CountMatchingItems | Counts items that would match the filter expression without writing any values; returns -1 when Source is not assigned. |
Events
| Name | Description |
|---|---|
| CallBackAction | Callback fired for every item while the rule is active, before action-based property assignments. |
| InactiveCallBackAction | Callback fired for every item when the rule is inactive, before action-based property assignments. |