web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Push all data of a table to read operation of AIF outbound service

(0) ShareShare
ReportReport
Posted on by 380

HI,

I need to push all the data of a table to read operation of the AIF outbound port through x++ or any other way in AX 2012 at a time.

Thanks in advance.

Regards,

Gyan 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Amir Nazim Profile Picture
    5,994 on at

    you can use this example

    The following code is used to execute the AIF File outbound  Service using Query  for AIF find Operation.

    ex:= Sales Table-salesid,another field and call AIF find to execute query criteria.

    static void krish_OutboundAifQueryProcess(Args _args)

       {

           AxdSendContext          axdSendContext      = AxdSendContext::construct();

           AifAction               aifAction ;

           AifConstraint           aifConstraint       = new AifConstraint();

           AifConstraintList       aifConstraintList   = new AifConstraintList();

           AifOutboundProcessingService AifOutboundProcessingService =

                                                     new AifOutboundProcessingService();

           AifGatewaySendService   AifGatewaySendService = new AifGatewaySendService();

            AifActionId                 actionId;

            AifEndpointList             endpointList;

            Query                               query;

            QueryBuildDataSource      queryBuildDataSource;

           ;

           query = new Query(queryStr(AIFCRMOrderReturn));

           queryBuildDataSource = query.dataSourceTable(tablenum(EDSACRMSyncLog));

           queryBuildDataSource.addRange(fieldnum(EDSACRMSyncLog,CRMOrderId)).

                                                                                       value(QueryValue('2500591'));

           queryBuildDataSource.addRange(fieldnum(EDSACRMSyncLog,DocReturn)).

                                                                                value(QueryValue(NoYes::No));

          aifAction = AifAction::find(AifSendService::getDefaultSendAction(classnum

                  (EDSACRMOrderReturnService),AifSendActionType::SendByQuery)) ;

           axdSendContext.parmXMLDocPurpose(XMLDocPurpose::Original);

           axdSendContext.parmSecurity(false);

           aifConstraint.parmType(AifConstraintType::NoConstraint);

           aifConstraintList.addConstraint(aifConstraint) ;

           endPointList=AifSendService::getEligibleEndpoints(aifAction.ActionId,aifConstraintList);

           AifSendService::submitFromQuery(aifAction.ActionId, endpointList, query, AifSendMode::Sync);

           AifGatewaySendService.run();

           AifOutboundProcessingService.run();

       }

  • Suggested answer
    gyan chand kabra Profile Picture
    380 on at

    Thanks Amir for your response

  • Amir Nazim Profile Picture
    5,994 on at

    please mark it is verified if this works for you, so others can also be benefited

  • Lauras U Profile Picture
    961 on at

    Correct my if I am wrong, but after switching to AifSendActionType::SendByQuery is not Read anymore it's a find operation.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans