The QuickFilter component provides a UI-based filtering capability against the integrated QuickList. It searches the associated list and refreshes the list with the search result. The QuickFilter component supports the following features:
The QuickFilter component is available in the Versions 6.2 and later of Zuora Quotes.
The QuickFilter component consists of:
The QuickFilter component accepts the following attribute.
Attribute | Type | Required? | Description |
---|---|---|---|
filterItems | List<zqu.FilterItem> | Optional | The filter items to be displayed. Use this attribute when you want an extra control over filter items, such as for complex business logic. If this attribute is not given, the fields of the Picklist type in the field set specified on the zqu__ZFilter__c object is used as select options. |
filterName | String | Required | The name identifier of the Filter object |
Use the FilterItem class to apply complex business logic to filters. This is an optional attribute of the QuickFilter component.
The FilterItem class has the following property options.
Property | Type | Required? | Description |
---|---|---|---|
displayType | Schema.DisplayType | Optional | The display type of the filter item. Accepted values are:
The default value is Picklist. |
filterFieldName | String | Required | Name of the field this filter is on |
label | String | Optional | Label of the filter item |
relatedObjectField | String | Optional | The API name of the field on the child object that references the parent object. You must provide the values for both the relatedObjectName and relatedObjectField in order to filter on a child object. |
relatedObjectName | String | Optional | The API name of the related child object that you want to filter on, for example, for filtering on attributes of the child ProductRatePlanCharges associated with selected ProductRatePlans. You must provide the values for both the relatedObjectName and relatedObjectField in order to filter on a child object. |
selectOptions | LIST<SelectOptions> | Required | The select options to be available in the filter. This is used for Picklist and MultiPicklist only. It is ignored for Boolean filters. |
size | Integer | Optional | Number of filter options to be displayed. Default is 1. This value is used for Picklist and MultiPicklist only. It is ignored for Boolean filters. |
To run the QuickFilter sample code:
public with sharing class TestQuickFilterController { public String filterName {get; set;} public List < zqu.FilterItem > items {get; set;} public TestQuickFilterController() { filterName = 'MyFilter'; // Initialize filter items items = new List < zqu.FilterItem >(); // Checkbox type zqu.FilterItem checkbox1 = new zqu.FilterItem(); checkbox1.label = 'Active (using Display Type of Boolean)'; checkbox1.filterFieldName = 'Active__c'; checkbox1.displayType = Schema.DisplayType.Boolean; checkbox1.size = 5; items.add(checkbox1); // Picklist type zqu.FilterItem picklist1 = new zqu.FilterItem(); picklist1.label = 'Version (using Display Type of Picklist)'; picklist1.filterFieldName = 'Version__c'; picklist1.displayType = Schema.DisplayType.Picklist; picklist1.size = 1; picklist1.selectOptions = new List < SelectOption >{ new SelectOption('', '--pick one--'), new SelectOption('Gold', 'Gold'), new SelectOption('Silver', 'Silver'), new SelectOption('Platinum', 'Platinum') }; items.add(picklist1); // Multi picklist type zqu.FilterItem picklist2 = new zqu.FilterItem(); picklist2.label = 'States (using Display Type of MultiPicklist)'; picklist2.filterFieldName = 'States__c'; picklist2.displayType = Schema.DisplayType.MultiPicklist; picklist2.size = 4; picklist2.selectOptions = new List < SelectOption >{ new SelectOption('CA', 'California'), new SelectOption('NY', 'New York'), new SelectOption('GA', 'Georgia'), new SelectOption('WA', 'Washington'), new SelectOption('TX', 'Texas') }; items.add(picklist2); } }
<apex:page controller="TestQuickFilterController"> <!-- Include the quickFilter component, identifying the filter object by name --> <zqu:QuickFilter filterName="MyFilter" filterItems="{!fiArr}"/> <!-- Include the quickList identified by the list name --> <zqu:QuickList contextIds="" listName="MyList"/> <!-- Include the breadcrumb component identified by the breadcrumb name --> <zqu:Breadcrumb name="MyList_breadCrumb" /> </apex:page>
This sample code shows how to create a QuickFilter on a related child object.
The following code creates a sub filter item that filters Product Rate Plans based on the zqu__Type__c field of their child Product Rate Plan Charges:
zqu.FilterItem filterItem = new zqu.FilterItem(); filterItem.label = 'Type'; filterItem.filterFieldName = 'zqu__Type__c'; filterItem.relatedObjectField = 'zqu__ProductRatePlan__c'; filterItem.relatedObjectName = 'zqu__ProductRatePlanCharge__c'; filterItem.displayType = Schema.DisplayType.Picklist; filterItem.size = 1; filterItem.selectOptions = new List < SelectOption > { 'One-Time', 'Recurring', 'Usage' };