Exago Logo
Search
Generic filters
Exact matches only

Custom Filter Functions

This article applies to the Admin Console > TreeData.png Extensions >TreeFilterFunction.png Filter Functions settings.


Custom Filter Functions provide the ability to make functions that will dynamically calculate a value for a filter using high level code.

Filter Functions can be written in C#, JavaScript, or VB.NET. Filter Functions written in C# and VB.NET can get and set elements from the current session of Exago, such as Parameter values. See Exago Session Info for more information.

Create, Edit, Delete, Restore Custom Filter Functions

  • To add a new custom filter function click TreeData.png Extensions > TreeFilterFunction.png Filter Functions in the Main Menu and either:
    • click the Add + icon at the top of the main menu
    • right-click and select + Add from the context menu
  • To edit a function either:
    • double click it
    • select it and click the Edit pencil icon at the top of the main menu
    • right-click it and select pencil Edit from the context menu
  • To delete an object either:
    • select it and click the Delete AdminDelete.png icon at the top of the main menu
    • right-click it and select X Delete from the context menu
  • To restore the default custom filter functions that come with the application either:
    • right-click TreeData.png Extensions > TreeFilterFunction.png Filter Functions in the Main Menu and select RefreshSmall.png Restore All Default Date Filter Functions from the context menu
    • navigate to TreeGeneral.png General > TreeGeneralNode.png Filter Settings > Restore All Default Date Filter Functions and click on the Refresh.png Restore button.
  • To save changes and new functions click the Apply or Okay buttons

Custom Filter Function Properties

Each Custom Filter Function has the following properties:

Name

A name for the filter function that will be displayed to the end users. Required.

Description

A description of the function.

Note

To support multi-language functionality, if the filter function’s name or description can be prepended with _wrFunctionId. If this ID matches the ID of any element in the language files, then the string of that language element will be displayed to the user instead of the function name/description in the Admin Console. For more information see Multi-Language Support.

Filter Type

Determines the data type that the filter function should be available for. Either Date, String, Integer or Decimal.

List Order

The order the filter function will appear among other filter functions of the same type. Functions with a lower number will appear higher on the list. If two functions have the same list value they will display in alphabetic order.

Note

All of the built in filter functions start with list value 100 or greater.

screen.CFF_info.png

Language

The high-level language of the code for the date function. May be C#, JavaScript, or VB.NET.

References

A semicolon-separated list of any DLLs that need to be referenced by the Custom Filter Function. The DLLs must be present in the bin folder of the Exago Web Application, Scheduler Services, and the Web Service API if applicable. This folder can be found in the installation directory of the respective component.

Note

System.dll does not need to be listed as a reference as it is already available.

Namespaces

A semicolon-separated list of any namespaces that need to be referenced by the Custom Filter Function.

Program Code

The program code for your Custom Filter Function. The code must return the data type that was set in the Filter Type setting. 

Note

Parameters may be referenced within custom functions by placing their name between @’s. For example, @[email protected]

screen.CFF_code.png
A Custom Filter Function that returns the date value of the last day of the current quarter

Click the Test custom code execution ✓ icon to verify that the code properly compiles.

Default Custom Filter Functions v2016.3+

Exago comes with a number of built-in custom filter functions. They are exposed in the Admin Console so they may be modified as needed.

Note

If these functions are unavailable, such as after an upgrade, follow the restore instructions in the Create, Edit, Delete, Restore Custom Filter Functions section above to add them back to the configuration automatically.

In all of the examples below, today’s date is assumed to be Friday, February 26, 2021.

FirstDayOfCurrentMonth

DescriptionReturns a DateTime representing the first day of the current month
Example2/1/2021

FirstDayOfCurrentQuarter

DescriptionReturns a DateTime representing the first day of the current quarter
Example1/1/2021

FirstDayOfCurrentYear

DescriptionReturns a DateTime representing the first day of the current year
Example1/1/2021

FirstDayOfLastMonth

DescriptionReturns a DateTime representing the first day of last month
Example1/1/2021

FirstDayOfLastQuarter

DescriptionReturns a DateTime representing the first day of last quarter
Example10/1/2020

FirstDayOfLastYear

DescriptionReturns a DateTime representing the first day of last year
Example1/1/2020

FirstDayOfNextMonth

DescriptionReturns a DateTime representing the first day of next month
Example3/1/2021

FirstDayOfNextQuarter

DescriptionReturns a DateTime representing the first day of next quarter
Example4/1/2021

FirstDayOfNextYear

DescriptionReturns a DateTime representing the first day of next year
Example1/1/2022

FridayOfCurrentWeek

DescriptionReturns a DateTime representing the Friday of the current week
Example2/26/2021

FridayOfLastWeek

DescriptionReturns a DateTime representing the Friday of the previous week
Example2/19/2021

FridayOfNextWeek

DescriptionReturns a DateTime representing the Friday of the next week
Example3/5/2021

LastDayOfCurrentMonth

DescriptionReturns a DateTime representing the last day of the current month
Example2/28/2021

LastDayOfCurrentQuarter

DescriptionReturns a DateTime representing the last day of the current quarter
Example3/31/2021

LastDayOfCurrentYear

DescriptionReturns a DateTime representing the last day of the current year
Example12/31/2021

LastDayOfLastMonth

DescriptionReturns a DateTime representing the last day of the previous month
Example1/31/2021

LastDayOfLastQuarter

DescriptionReturns a DateTime representing the last day of the previous quarter
Example12/31/2020

LastDayOfLastYear

DescriptionReturns a DateTime representing the last day of the previous year
Example12/31/2020

LastDayOfNextMonth

DescriptionReturns a DateTime representing the last day of the next month
Example3/31/2021

LastDayOfNextQuarter

DescriptionReturns a DateTime representing the last day of the next quarter
Example6/30/2021

LastDayOfNextYear

DescriptionReturns a DateTime representing the last day of next year
Example12/31/2022

MondayOfCurrentWeek

DescriptionReturns a DateTime representing Monday of the current week
Example2/22/2021

MondayOfLastWeek

DescriptionReturns a DateTime representing Monday of the previous week
Example2/15/2021

MondayOfNextWeek

DescriptionReturns a DateTime representing Monday of the next week
Example3/1/2021

Today

DescriptionReturns a DateTime representing today’s date
Example2/26/2021

TodayMinus30Days

DescriptionReturns a DateTime representing the date 30 days prior to today
Example1/27/2021

TodayMinus60Days

DescriptionReturns a DateTime representing the date 60 days prior to today
Example12/28/2020

TodayMinus7Days

DescriptionReturns a DateTime representing the date 7 days prior to today
Example2/19/2021

TodayMinus90Days

DescriptionReturns a DateTime representing the date 90 days prior to today
Example11/28/2020

TodayPlus30Days

DescriptionReturns a DateTime representing the date 30 days in the future from today
Example3/28/2021

TodayPlus60Days

DescriptionReturns a DateTime representing the date 60 days in the future from today
Example4/27/2021

TodayPlus7Days

DescriptionReturns a DateTime representing the date 7 days in the future from today
Example3/5/2021

TodayPlus90Days

DescriptionReturns a DateTime representing the date 90 days in the future from today
Example5/27/2021

Tomorrow

DescriptionReturns a DateTime representing tomorrow’s date
Example2/27/2021

Yesterday

DescriptionReturns a DateTime representing yesterday’s date
Example2/25/2021
Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Table of Contents