Manipulating the filter selection formula via Integra's events
Let us say that you would like to specify a selection formula 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 selection formula in the CB_INITIALISE OR CB_BFOREXPORT event in the Advanced Script Callback tab. The selection formula is set as follows:
case CB_INITIALISE
dim usrdoc as NotesDocument
dim co_name as string
set usrdoc = GetUserProfile()
co_name = usrdoc.Dialog_CompanyName(0)
struct.SelectionFormula = |CompanyName = "| & co_name & |"|
2) Specify the selection formula 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 selection formula which is placed in the Selection Formula field:
CompanyName = "#company#"
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 co_name as string
set usrdoc = GetUserProfile()
co_name = usrdoc.Dialog_CompanyName(0)
struct.SelectionFormula = stats.utilities.utlReplaceStr(struct.SelectionFormula,"#company#",co_name)
See also: Manipulating filter conditions via Integra's events
|