Xfor First command

Official Content
This documentation is valid for:

This command is similar to the Xfor Each command, but it does not iterate (loop). It returns the first record (if there is a record) of the external file using the specified index and filtering data according to the Conditions declared in the Where statements.

GeneXus will try to optimize the search in an intelligent way, taking into account the index specified in the Xfor Each group and the conditions established in the Where statement of the Xfor Eeach group.


Xfor first 'file_name'  [Index 'index_name']
       { [ Where condition ] }…
       [When None]


    Is the name of the Data View object defined to access the external file.

    Defines the name of the index to be used.

    Is the name of the Data View Index.

    Clause that can be specified to establish a condition for data retrieval.

    Any valid logical expression.

when none
     Specify the code to be executed when the first Xfor each does not filter any record.


Objects: Procedure object, Transaction object, Web Panel object

See Also

Xfor Each command
Where clause
When None Clause

More here

Data View object