--- title: "Scoped Line Items Filterer" slug: "scoped-line-items-filterer" updated: 2023-06-27T16:20:05Z published: 2023-06-27T16:20:05Z canonical: "docs.zilliant.com/scoped-line-items-filterer" --- > ## 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. # Line Items Filterer Class This Apex hook adds filter conditions to the query that retrieves lines to be shown in an instance of the **Line Items** component. The hook filters out records before a line list is presented to a user in the **Line List** view. ## Apex hook class - It must implement the **ScopedLineItemsFilterer** interface. - It must have a global access modifier. - You must specify the Apex hook class name in the **Line Items Filterer Class Name** field of the **Product Selector Configuration**. ## Interface definition ``` /** * Interface for a hook class that encapsulates custom Contract Line Items pre-entry fields * filtering logic on Line-Items page. This version of the interface extends * LineItemsFilterer to add the option to include scoping restrictions. * To ignore scope, use LineItemsFilterer directly. */ global interface ScopedLineItemsFilterer extends LineItemsFilterer { /** * @param headerRecordId the ID of current Header object record (ID of Contract or Price Lookup 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 ContractLineItems. */ zal.Condition getScopedFilterCondition(Id headerRecordId, Map scope); } ``` ## Example of the class implementation ``` public with sharing class SimpleScopedLineItemsFilterer implements zpl.ScopedLineItemsFilterer { public zal.Condition getScopedFilterCondition(Id headerRecordId, Map scope) { String var = (String)scope.keySet().iterator().next(); return new zal.FieldCondition(Schema.SObjectType.zpl__ContractLineItem__c.fields.zpl__LevelValue__c.getName(), zal.Operator.EQUALS, scope.get(var)); } public zal.Condition getFilterCondition(Id headerRecordId) { return null; } } ```