Table of contents



Official Content

A Data Selector object can be used in a Data Provider object in the same way as in a For Each command.

Some examples already seen in Data Selectors in For Each command show this.

If you have the following Data Selector:

DataSelectorExampleB

From a Data Provider you can return the list of customers having an invoice in a given range (for example, taken from parameters):

1) 'USING' clause

Clients
{
     Client USING InvoicesByDate( &FromDate, &ToDate )
     {
        Code = CustomerId
        Name = CustomerName
     }
}

When invoking a Data Selector through the "USING" clause in a group (same as a For each), the Data Selector doesn't have an associated navigation (it doesn't have a base table by itself). At specification time, the Data Selector definition is combined with the Group definition to determine the table that will be navigated, taking into account the attributes of both definitions. So, the base table associated with the 'Client' group will be INVOICE.

2) 'IN' operator in the Where clause

Clients
{
    Client
    where CustomerName IN InvoicesByDate( &FromDate, &ToDate )
    {
       Code = CustomerId
       Name = CustomerName
    }
}

The Data Selector query will return a collection of values corresponding to the same definition as the attribute that precedes the IN operator. In the above example, the Data Selector returns 'a customer list' with invoices in the given range.

For further information, see Data Selectors in For Each command

See also

Data Selectors in Grids
Data Selectors in Aggregations
Data Selectors in For Each command

Videos

Start Video Data Selectors



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