Official Content

Returns the first record of an external file using the specified index and filtering data according to the Conditions declared in the where statements.

Syntax

Xfor first <file_name>  [Index <index_name>]
      [Where <condition1>]
       …
      [Where <conditionN>]
      [When None]
Xendfor

View Syntax conventions

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.

condition1,...,conditionN
    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, Transaction, Web Panel

Description

This command is similar to the Xfor Each command, but it does not iterate (loop). It returns the first record (if there is one) 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.

See Also

Xfor Each command

              


Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant