Manipulating filter conditions via Integra's events
Let us say that you would like to specify a filter condition in an Integra profile and use values entered by users at run-time, for example via a custom dialog. There are two ways to achieve this:
1) Specify the filter condition in the CB_INITIALISE OR CB_BFOREXPORT event in the Advanced Script Callback tab. The filter condition is set as follows:
case CB_INITIALISE
dim usrdoc as NotesDocument
dim period_from as string
dim period_to as string
set usrdoc = GetUserProfile()
period_from = usrdoc.Dialog_DateFrom(0)
period_to = usrdoc.Dialog_DateTo(0)
stats.FTFilter = |FIELD DateJob >= | & period_from & | AND FIELD DateJob <= | & period_to
2) Specify the filter condition in the Filtering & Sorting tab of the Integra profile using place holders for the values to be determined at run-time. Below is a sample filter condition which can be written directly inside the Filter Condition field:
FIELD DateJob >= #period_from# AND FIELD DateJob <= #period_to#
The place holders need to be replaced by the values entered by the users at runtime. This is done by placing the code below in the CB_INITIALISE or CB_BFOREXPORT event in the Advanced Script Callback tab:
case CB_INITIALISE
dim usrdoc as NotesDocument
dim period_from as string
dim period_to as string
set usrdoc = GetUserProfile()
period_from = usrdoc.Dialog_DateFrom(0)
period_to = usrdoc.Dialog_DateTo(0)
stats.FTFilter = stats.utilities.utlReplaceStr(stats.FTFilter,"#period_from#",period_from)
stats.FTFilter = stats.utilities.utlReplaceStr(stats.FTFilter,"#period_to#",period_to)
See also Manipulating the filter selection formula via Integra's events
|