|
Tip>Designer |
|
|
Dynamically filter the records in a DataLink |
|
|
Article #: |
0016 |
|
Contributor: |
Joanne Irvine-Smith |
|
GF version: |
3.05 |
|
Applies to: |
Records in a DataLink |
|
Last updated: |
October 15, 2001 |
Description
Dynamically filter the records in a DataLink, thereby limiting the list of records presented to a user at run time.
Explanation
You can set a filter on a DataLink from within a FillPoint. This filter is then set each time the template is run, and a list of filtered records is presented to the user in the data selection interface.
Click here to view a step-by-step example.
To create a FillPoint that sets a filter, do the following:
In the GhostFill FillPoint Editor, send the SetFilter task to the editing area. The contents of the FillPoint are displayed as follows:
Expand the FillPoint.
The first parameter is a Field Name, e.g. click the parameter and type 'Date Effective' in quotes.
The second parameter is the Comparison argument e.g., click the parameter and type '=' in quotes.
|
NOTE |
|
For a list of constants that are valid for this argument, see the Databases folder in the Tasks tab (see the GhostFill Scripting Language Guide for a detailed description of the SetFilter Constants). |
The third parameter is the field's Value,e.g. click the parameter and type Date().
The contents of the SetFilter FillPoint are as follows:
The FillPoint inserted into the template will be as follows:
%[DataServerVariable.SetFilter('Date Effective', '=', Date())]
At run time, this FillPoint will filter the records in the data source to include only those records where the Date Effective field equals the system date. The records that fit these specifications will be displayed in the data selection interface.
Template Example
Click here to view the data selection interface before the filter is set.
|
LEASE TERMINATION AGREEMENT %[^Lease = DataBases.Select('\Knowledge Base', 'Lease')] %[DataServerVariable.SetFilter(Lease.Date_Effective, '=', Date())] %[~Lease.ChooseRow()]
This Lease Termination Agreement is entered into by and between %[Lease.Landlord], an individual with the address of %[Lease.Landlord_Address] ("Landlord"), and %[Lease.Tenant], an individual with the address of %[Lease.Tenant_Address] ("Tenant").
|
Click here to view the filtered data selection interface.