Search This Blog

Friday, November 4, 2011

How to get the AIF XML for OutBound interface using X++

static void krish_OutboundXMLAifProcess(Args _args)
    {
        AIFQueryCriteria   QueryCriteria=AIFQueryCriteria::construct();
        AIFCriteriaElement   criteriaElement1,criteriaElement2;
         EDSACRMOrderReturnService   CRMOrderReturnService;
         AIFXml  aifXMl;
        ;
        CRMOrderReturnService=EDSACRMOrderReturnService::construct();
        criteriaElement1=AIFCriteriaElement::newCriteriaElement(tablestr(EDSACRMSyncLog),fieldstr
                                   (EDSACRMSyncLog,CRMOrderId),AIFCriteriaOperator::Equal,'10345');
        criteriaElement2=AIFCriteriaElement::newCriteriaElement(tablestr(EDSACRMSyncLog),fieldstr 
                                  (EDSACRMSyncLog,DocReturn),AIFCriteriaOperator::Equal,Enum2str
                                  (NoYes::No));
      QueryCriteria.addCriteriaElement(criteriaElement1);
      QueryCriteria.addCriteriaElement(criteriaElement2);

      aifXMl=CRMOrderReturnService.find(QueryCriteria).serialize();

    }

1 comment:

  1. Very nice. I readily adapted this for the SalesSalesInvoiceService class.

    ReplyDelete

Thanks for visiting my blog,
I will reply for your comment within 48 hours.

Thanks,
krishna.