Autofill while setting a filter

<< Click to Display Table of Contents >>

Navigation:  User Interface > The Data Form > Advanced Input >

Autofill while setting a filter

Autofill while setting a filter

You have the possibility to set an autofill while defining a filter for a specific field in the filter mask. In order to do so you must specify a scripting for a specific field that will be activated only in the filter mask, and inside of it explicitly enable the function with the parameter .AUTOFILLWHENFILTER .

For further details on how to create a scripting to be executed while editing a field, please refer to the topic Advanced data input.

For a description of the filtering mask, please refer to the topic Filters.

 

.AUTOFILLWHENFILTER

If declared in a standard .LST file with a query declared, when in the FILTER images_Autofi1 functionality, MechworksPDM fills automatically the field with one of the possible results of the query.

This parameter is needed if you want to avoid a free input in a field of the main form mask while setting a new filter.

Example:

Suppose you want to create a DESCRIPTION.LST sample lst file so to drive the input of the field DESCRIPTION.

This may be written as:

.SQL

.KEY 0

SELECT DESCRIPTION,CREATED_BY FROM DOCUMENT WHERE ID LIKE 'C%';

Suppose the values for the DESCRIPTION field are:

C01 part 01

C02 part 02

C03 part 03

When clicking on the button for the list box of the DESCRIPTION field in FILTER you will see something like:

C01 part 01 ciro ettorre

C02 part 02 gaetano tavano

C03 part 03 giorgio malagutti

You are allowed to enter in the field, for example, the value:

C0

so to filter all the records for which the description begins with the string C0.

The filtered list will therefore contain these THREE records.

Now, if we use the new parameter .AUTOFILLWHENFILTER, so writing the LST file as:

.SQL

.KEY 0

.AUTOFILLWHENFILTER

SELECT DESCRIPTION,CREATED_BY FROM DOCUMENT WHERE ID LIKE 'C%';

when clicking on the button for the list box of the DESCRIPTION field in FILTER you will see something like:

C01 part 01         |             ciro ettorre

C02 part 02         |             gaetano tavano

C03 part 03         |             giorgio malagutti

You are NOT allowed to assign nothing but a string MATCHING one of the possible choises, that is:

C01 part 01 or C01 part 02 or C01 part 03.

The filtered list will therefore contain only ONE record.