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

Some examples already seen in 'Data Selectors in For each Groups' 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 to 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 which precedes the IN operator. In the above example, the Data Selector returns 'a customers 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
[5775]
Work With List Node
[16337]

Videos

Start Video Data Selector object