---
id: object/codeunit/41
type: object
title: Codeunit 41 "Filter Tokens"
summary: Codeunit 41 "Filter Tokens" in System Application (System.Text). 4 public procedures, 5 events. Present since at least BC23, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - system application
versions:
  introduced: null
  last_changed: null
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 21afdff8855c5fd4481d444e62b5448c24b6a131f481fdc5b8a03680017f7e54
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Filter%20Tokens/src/FilterTokens.Codeunit.al
    title: src/System Application/App/Filter Tokens/src/FilterTokens.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 41
name: Filter Tokens
namespace: System.Text
app: System Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 9
  events: 5
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 2
  calls: 1
  called_by: 13
  implements: 0
---

# Codeunit 41 "Filter Tokens"

> Codeunit 41 "Filter Tokens" in System Application (System.Text). 4 public procedures, 5 events. Present since at least BC23, still in BC30.

System Application · System.Text · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Filter%20Tokens/src/FilterTokens.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Public |
| SingleInstance | true |

## Events published

- `OnResolveDateFilterToken(DateToken: Text; var FromDate: Date; var ToDate: Date; var Handled: Boolean)` (integration): Use this event if you want to add support for additional tokens that user will be able to use when working with date filters, for example "Christmas" or "StoneAge". Ensure that in your subscriber you check that what user entered contains your keyword, then return proper date range for your filter to...
  - subscribers: [Codeunit 360 "Accounting Period Mgt."](../codeunit/360.md) OnResolveDateFilterToken
- `OnResolveTextFilterToken(TextToken: Text; var TextFilter: Text; var Handled: Boolean)` (integration): Use this event if you want to add support for additional filter tokens that user will be able to use when working with text or code filters, for example "MyFilter". Ensure that in your subscriber you check that what user entered contains your token, then return properly formatted text for your filte...
  - subscribers: [Codeunit 9150 "My Records Filter Sub."](../codeunit/9150.md) DoOnResolveTextFilterToken
- `OnResolveTimeFilterToken(TimeToken: Text; var TimeFilter: Time; var Handled: Boolean)` (integration): Use this event if you want to add support for additional filter tokens that user will be able to use when working with time filters, for example "Lunch". Ensure that in your subscriber you check that what user entered contains your token, then return properly formatted time for your filter token.
- `OnResolveDateTokenFromDateTimeFilter(DateToken: Text; var DateFilter: Date; var Handled: Boolean)` (integration): Use this event if you want to add support for additional filter tokens that user will be able to use as date in DateTime filters. Parses and translates a date token into a date filter.
- `OnResolveTimeTokenFromDateTimeFilter(TimeToken: Text; var TimeFilter: Time; var Handled: Boolean)` (integration): Use this event if you want to add support for additional filter tokens that user will be able to use as time in DateTime filters. Parses and translates a time token into a time filter.

## Procedures

- `MakeDateFilter(var DateFilterText: Text)`: Turns text that represents date formats into a valid date filter expression with respect to filter tokens and date formulas. Call this function from onValidate trigger of page field that should behave similar to system filters. The text from which the date filter should be extracted passed as VAR. F...
- `MakeTimeFilter(var TimeFilterText: Text)`: Turns text that represents a time into a valid time filter with respect to filter tokens. Call this function from onValidate trigger of page field that should behave similar to system filters.
- `MakeTextFilter(var TextFilter: Text)`: Turns text into a valid text filter with respect to filter tokens. Call this function from onValidate trigger of page field that should behave similar to system filters.
- `MakeDateTimeFilter(var DateTimeFilterText: Text)`: Turns text that represents a DateTime into a valid date and time filter with respect to filter tokens. Call this function from onValidate trigger of page field that should behave similar to system filters.

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 58 "Filter Tokens Impl."](../codeunit/58.md) (4 calls: `MakeDateFilter → MakeDateFilter`, `MakeDateTimeFilter → MakeDateTimeFilter`, `MakeTextFilter → MakeTextFilter`, …)

## Called by

- [Codeunit 58 "Filter Tokens Impl."](../codeunit/58.md) (5 calls: `MakeTextFilter → OnResolveTextFilterToken`, `ResolveDateFilterToken → OnResolveDateFilterToken`, `ResolveDateText → OnResolveDateTokenFromDateTimeFilter`, …)
- [Page 113 "Budget"](../page/113.md) (1 call: `ValidateDateFilter → MakeDateFilter`)
- [Page 221 "Resource Allocated per Job"](../page/221.md) (1 call: `DateControl → MakeDateFilter`)
- [Page 228 "Res. Gr. Allocated per Job"](../page/228.md) (1 call: `DateControl → MakeDateFilter`)
- [Page 344 "Navigate"](../page/344.md) (1 call: `SetPostingDate → MakeDateFilter`)
- [Page 408 "G/L Balance by Dimension"](../page/408.md) (1 call: `SetDateFilter → MakeDateFilter`)
- [Page 5915 "Service Tasks"](../page/5915.md) (1 call: `SetRespDateFilter → MakeDateFilter`)
- [Page 6004 "Res. Availability (Service)"](../page/6004.md) (1 call: `DateControl → MakeDateFilter`)
- [Page 6008 "Res. Alloc. per Service Order"](../page/6008.md) (1 call: `DateControl → MakeDateFilter`)
- [Page 6009 "Res. Gr. Alloc. per Serv Order"](../page/6009.md) (1 call: `DateControl → MakeDateFilter`)
- [Page 6010 "Res.Gr. Availability (Service)"](../page/6010.md) (1 call: `DateControl → MakeDateFilter`)
- [Page 9209 "Invt. Analys by Dim. Matrix"](../page/9209.md) (1 call: `LoadMatrix → MakeDateFilter`)
- [Report 25 "Account Schedule"](../report/25.md) (1 call: `ValidateDateFilter → MakeDateFilter`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: none

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Filter Tokens")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
