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.

Syntax

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

Where:

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

index
    Defines the name of the index to be used.

index_name
    Is the name of the Data View Index.

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

condition
    Any valid logical expression.

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

Scope

Objects: Procedure object, Transaction object, Web Panel object

See Also

Xfor Each command
Where clause
When None Clause

More here

Data View object

 





Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.