Delete a filter from the database.
Permanently removes the specified filter. This operation cannot be undone.
Promise that resolves when the filter is deleted
Save a filter definition to the database.
Creates a new filter or updates an existing one. The filter will be stored persistently and become available for use in queries and filter expressions.
If a filter with the same id already exists, it will be updated with the
new values. Otherwise, a new filter is created.
Promise that resolves when the filter is saved
const repo = platform.get(PlatformServiceName.FilterRepository);
const filter: Filter = {
id: 'my_deals',
limetype: 'deal',
name: { 'en': 'My Deals' },
filter: { key: 'owner', op: Operator.EQUALS, exp: currentUserId }
};
await repo.save(filter);
Subscribe to state changes with optional transformation and filtering.
The subscription will immediately invoke the callback with the current state (if any), then continue to call it whenever the state changes. The map and filter options allow you to transform and selectively receive updates.
Function called with state updates (after map/filter applied)
Optionaloptions: StateOptionsOptional transformations and filters for the subscription
Unsubscribe function - call this to stop receiving updates
Repository for managing saved filter definitions.
FilterRepository provides methods to create, update, and delete Filter definitions. Filters are named, reusable query expressions that can be applied to limetypes to define subsets of objects (e.g., "My Active Deals", "High Priority Tickets").
Filters can be:
iduseris set)The repository extends StateRepository, enabling:
Example
Basic usage
See