Показать сообщение отдельно
Старый 08.08.2006, 11:30   #16  
Jabberwocky is offline
Jabberwocky
Microsoft Dynamics
Аватар для Jabberwocky
Сотрудники Microsoft Dynamics
 
274 / 307 (11) ++++++
Регистрация: 02.09.2005
Адрес: Москва
Пример из Developer's Guide:

Modifying the Fetch method on a report
The Fetch method is the main loop of a report. The programmer may override the fetch method if there are very special constraints on which records to show. The Fetch method can be modeled in X++ as

//Create a new query to fetch the records
QueryRun qr = new QueryRun(element.query());

//Open the prompt dialog
if(qr.prompt())

{ //The user didn't press cancel
while(qr.next())
{
file = qr.get(file); //For all data sources
send(file);
}
}

If you want to print only records that satisfy some special constraint that is difficult to express as a range in the query, write the code above, and only allow Send to be called if the constraint (expressed as a function by the same name in the example below) is satisfied:

while (qr.next())
{
file = qr.get(file); //For all data sources
if(constraint())
send(file);
}
__________________
You should use Bing before asking dumb questions.