Top Level Filters
When there is a lot of data, it can be helpful to filter the data found within a top-level object. For example, you may have a filter which shows all Accounts of type Competitor. Or all Opportunities which are Pending. Any top level object can be filtered, and multiple filters may be configured for a single module. These filters are written typically in JavaScript/JSON.
When you mark an object as Top Level within Module settings in the administration application, it will then appear underneath the Top Level Filters section of the application. To create a Top Level Filter:
- Under the Top Level Filter section of the Administration application, click on the object you'd like to create a top level filter for.
- You can then add a new filter by clicking Add.
- In the window that appears, give your new filter a name. This name will be displayed in the client. Names can also be provided as device messages, for ease of use in multi-language implementations. For example, you could give a filter a name of filter.all, and then in the Device Messages section of the Administration application, create a new device message called filter.all whose value is All Accounts. Please see Changing Device Messages for more information.
- This filter can be "on" by default if you choose the Is Default option to be yes.
- In the Script area, you would enter JavaScript to provide your filter. The function that is used here is onLoadFilterJSON().
This is a very basic example of a filter:
<html><head><title>Filter</title><script type="text/javascript"> function onLoadFilterJSON() { return "[ {\"action\":\"getcondition\", \"filter\":\"1.ACCTKW01 = \"Competitor\"\" } ]"; } </script></head><body></Body></html>
To change the order of the filters click on 'Order Changes' at the top of the page. A second window will appear displaying the filters where you may click and drag to rearrange their order. Once you are done you may either click 'Update' to retain the changes, or the 'X' to close the window and return to the previous configuration.