--- title: "CDTScopedRecordsFilterer" slug: "cdtscopedrecordsfilterer" updated: 2023-06-29T12:24:19Z published: 2023-06-29T12:24:19Z canonical: "docs.zilliant.com/cdtscopedrecordsfilterer" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.zilliant.com/llms.txt > Use this file to discover all available pages before exploring further. # CDT Scoped Records Filterer Class This Apex hook is specific to the Zilliant-developed **Configurable Data Table** component. The hook uses the context of a deal, a user, and each line to determine which line should be shown to a specific user in that current instance of the **Configurable Data Table** view. The hook occurs when a specific **Configurable Data Table** instance is displayed to a user and controls the records the user sees in the component. ## Apex hook class - It must implement one of the following two interfaces: - **RecordsFilterer** - **ScopedRecordsFilterer** - It must have a global access modifier. - You must specify the Apex hook class name in the **Record Filterer Class Name** field of the **Extension Point Configuration** for the **Configurable Data Table** component. ## ScopedRecordsFilterer interface definition ``` /** * Interface for a hook class that encapsulates custom filtering logic on records for a Data table. * This version of the interface extends RecordsFilterer to add the option to include scoping restrictions. * To ignore scope, use LineItemsFilterer directly. */ global interface ScopedRecordsFilterer extends RecordsFilterer { /** * @param headerRecordId the ID of current Header object record * @param scope map of system-defined values by which to constrain the available records * KEY: name of the scoping element, VALUE: value of the scoping element * * @returns a condition that should be used on selecting records. */ zal.Condition getScopedFilterCondition(Id headerRecordId, Map scope); } ``` ## RecordsFilterer interface definition ``` /** * Interface for a hook class used to build a custom filter condition for the records displayed on a data table. * * @param headerRecordId the ID of current Header object record * @return a condition used when displaying records on a data table. */ global interface RecordsFilterer { zal.Condition getFilterCondition(Id headerRecordId); ``` ## Example: ScopedRecordsFilterer implementation ``` public class RecordFiltererScopeDummy implements ScopedRecordsFilterer { public zal.Condition getFilterCondition(Id headerRecordId) { return null; } public zal.Condition getScopedFilterCondition(Id headerRecordId, Map params) { zal.OrCondition andCondition = new zal.OrCondition(); zal.OrCondition orcondition = new zal.OrCondition(); orcondition.add(new zal.FieldCondition('Name').likex('%' + params.get('param1'))); orcondition.add(new zal.FieldCondition('Name').likex('%' + params.get('param2'))); andCondition.add(orcondition); andCondition.add(new zal.FieldCondition('zpl__Cost__c').greaterThan(5)); return andCondition; } } ``` ## Example: RecordsFilterer implementation ``` public class RecordFiltererDummy implements RecordsFilterer { public zal.Condition getFilterCondition(Id headerRecordId) { zal.OrCondition condition = new zal.OrCondition(); condition.add(new zal.FieldCondition('Name').likex('Next%')); condition.add(new zal.FieldCondition('Name').likex('WW%')); return condition; } } ```