Ir para o conteúdo

How To Configure a Pre-Set Filter

In Vinyl you can configure a Grid panel to load with a pre-set filter value. The filter can easily be cleared out by the User, if desired, to see all results (not just the filtered set). This article will step you through how to configure a pre-set filter.

In terms of where you will configure the pre-set filter, it can be configured on any control that can act as a link. You might configure the filter on a Button control that exists on a Parameter page. Alternatively you might configure it on the Site Menu using a Site Menu Object.

Business Use Case Example

To illustrate this concept, consider the business use case scenario where you have an Accounts panel and you would like the records that initially load to only display those in the Status of Qualified or Lead. Without the pre-set filter in place, the panel is currently loading all records including those of the Status Closed Lost and Closed Won.

presetfilter.png

Accounts panel with pre-set filter

allstatus.png

Accounts panel with no pre-set filter configured

To Configure a Pre-Set Filter driven by Button Control

In this scenario we will configure a pre-set filter using Button control residing on a Parameter page. This configuration assumes you have a Parameter table in place, with columns referring to the StatusID values you wish to use as Filters. We also assume you have a Business Rule defined, which represents a Business Object built off of the Parameter table and contains the StatusID values in it that you want represented by the filter.

  1. Navigate in your app to the area from which you'll define the pre-set filter. For example: Parameter page
  2. Go to the Action Drawer > Live Designer
  3. Select the control on the panel you want to filter on
  4. Click teh Button tab
  5. Expand Navigation and Actions
  6. Set the Link to Page value
  7. Click the Link Criteria button
  8. Click + Criteria
  9. Set the Source Column as StatusID1 and the Target Column as {{PanelName}}.$f.in.StatusID.0
  10. Leave the Type value as Bind
  11. Click the checkmark icon to save
  12. Click Create
  13. Set the Source Column as StatusID2 and the Target Column as {{PanelName}}.$f.in.StatusID.1
  14. Leave the Type value as Bind
  15. Click the checkmark icon to save
  16. Return to the application view, and test that the button now takes the User to the appropriate panel with the pre-set filter being applied

To Configure a Pre-Set Filter driven by Site Menu Object

If you are looking to have a page off of the application Site Menu load with the pre-set Filter applied, you can configure the pre-set Filter using a Site Menu Object. For example, we would like the Accounts panel to load in a filtered state when the User clicks on Accounts from the application Site Menu.

This configuration assumes you have a Parameter table in place, with columns referring to the StatusID values you wish to use as Filters. We also assume you have a Business Rule defined, which represents a Business Object built off of the Parameter table and contains the StatusID values in it that you want represented by the filter.

paramcolumnexamples.png

Parameter table illustrating the Columns defined to represent Qualified and Lead StatusID

  1. Navigate to the App Workbench > Menu
  2. Click Open Record for the Application Menu
  3. Click Edit
  4. Set the Source Rule value to the configured Business Rule containing the defined filter values
  5. Click Save
  6. Click x to exit out of the Menu panel
  7. Locate the navigation value you want to configure from the Menu Items panel. For example: Accounts
  8. Click Open Record
  9. Click Link Options
  10. Click the Link Criteria icon
  11. Click Create
  12. Set the Source Column as StatusID1 and the Target Column as {{PanelName}}.$f.in.StatusID.0.

    For example:

    • Source Column = LeadStatusID
    • Target Column = Accounts.$f.in.AccountStatusID.1
  13. Leave the Type value as Bind

  14. Click the checkmark icon to save
  15. Click Create
  16. Set the Source Column as StatusID2 and the Target Column as {{PanelName}}.$f.in.StatusID.1
  17. Leave the Type value as Bind
  18. Click the checkmark icon to save
  19. Click x to exit out of the Control Link Criteria screen
  20. Return to the application view, refresh the web browser and test