AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 14.07.2010, 19:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
paruvella: AIF – Outbound with a number of Records per XML
Источник: http://paruvella.spaces.live.com/Blo...4DB0!545.entry
==============

Again I am back with some AIF stuff.

Assume that if we have a requirement like, we need to send at least 10 records per XML as an outbound.

Have a look on the following example which gives an idea, how we can send 10 or some number of records in an XML as an outbound.


X++:
static void AIFSendChAccForRangeRec(Args _args)
{
    AxdSendContext                      axdSendContext = AxdSendContext::construct();
    AifConstraint                       aifConstraint = new AifConstraint() ;
    AifConstraintList                   aifConstraintList = new AifConstraintList();
    AifActionId                         actionId;
    AifEndpointList                     endpointList;
   
    Query                               query;
    QueryBuildDataSource                queryBuildDataSource;
    QueryBuildRange                     qbr;
    RecId                               start;
    RecId                               end;
    LedgerTable                         ledgerTable;
     ;
   
    //reading lowest recordId for a specific criteria
    select firstonly RecId from ledgerTable where ledgerTable.AccountPlType == LedgerAccountType::Heading;
   
    start = ledgerTable.RecId;
    end = start + 100;          // add some value to the recordId. This increment value we can change depends on req.
   
    query = new Query(queryStr(AxdChartOfAccounts));
   
    AxdSend::removeChildDs(query);
   
    queryBuildDataSource = query.dataSourceTable(tablenum(LedgerTable));
    queryBuildDataSource.addRange(fieldnum(LedgerTable, AccountPlType)).value(QueryValue(LedgerAccountType::Heading));
   
    qbr = queryBuildDataSource.addRange(fieldnum(LedgerTable, RecId));
   
    //here adding the records range condition, to filter the no.of records to send in XML
    qbr.value(strfmt('( (%1 >= %2) && (%1 <= %3) )',
                       fieldstr(LedgerTable, RecId),
                       start,
                       end));
   
    actionId = AifSendService::getDefaultSendAction(classnum(LedgerChartOfAccountsService), AifSendActionType::SendByQuery);

    aifConstraint.parmType(AifConstraintType::NoConstraint);
    aifConstraintList.addConstraint(aifConstraint);
    endpointList = AifSendService::getEligibleEndpoints(actionId, aifConstraintList);

    //implemented the AIF-Outbound using query object
    AifSendService::submitFromQuery(actionId, endpointList, query, AifSendMode::Async);

}
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
paruvella: Generation of XML file from DAX, without using AIF Blog bot DAX Blogs 0 23.04.2010 12:05
Dave: AIF Configuration and Additional Findings Blog bot DAX Blogs 1 04.11.2009 17:29
axStart: How to use XSLT in AIF and what’s wrong with empty xml Nodes. Blog bot DAX Blogs 0 27.04.2008 18:07
Dianne Siebold: Limit Outbound Documents in 4.0 (AIF) Blog bot DAX Blogs 0 12.01.2008 00:23
Pokluda: Outbound web service (AIF) Blog bot DAX Blogs 0 28.10.2006 17:43

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 20:22.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.