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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 15.07.2008, 02:13   #1  
Blog bot is offline
Blog bot
Участник
 
25,617 / 848 (80) +++++++
Регистрация: 28.10.2006
axStart: Getting Dynamics AX information into Dynamics CRM, the easy way.
Источник: http://axstart.spaces.live.com/Blog/...C0A0!359.entry
==============


Most of the time, when additional AX information is required in Microsoft CRM. It is information like:
  • Invoice information
  • Payment schedule information
  • Delivery information of sales orders
    Etc.
The look and feel of this information should be the responsibility of Dynamics CRM. Dynamics AX should provide the information. There are 2 ways Dynamics CRM can connect to Dynamics AX:
  • AIF Web services
    .Net Connector in combination with AIF base classes:
Personally I don’t think you need the Web services when Dynamics CRM and Dynamics AX are in the same domain. So install an AX dot Net client on the Dynamics CRM Server. The number of different used technologies is lower this way and that is always better to my opinion.
So how can we use the AIF base classes in c#?
I will use the base classes, In the next example. Additional the received XML file is converted to HTML with an XSL translation. This page can directly be shown in Dynamics CRM.
Example of using AIF base classes with x++.
In this example I call the framework twice, the first time the findEntityKeyList service, the second time the readList service. I only have to care about the correct ranges on my query object.
AIFDocumentXML                  aIFDocumentXML;
Query                                   query                                   = new Query(querystr(CustInvoiceJour));
AxdCustInvoiceJour                axdCustInvoiceJour               = axdBase::newClassId(classnum(AxdCustInvoiceJour));
AifQueryCriteria                     aifQueryCriteria                     = AifQueryCriteria::construct();
AifEndpointActionPolicyInfo    aifEndpointActionPolicyInfo    = new AifEndpointActionPolicyInfo();
;
aifQueryCriteria.parmQuery(query);
aIFDocumentXML = axdCustInvoiceJour.readList(
   axdCustInvoiceJour.findEntityKeyList(aifQueryCriteria, aifEndpointActionPolicyInfo),
   null,
   AifEndpointActionPolicyInfo,
   new AifConstraintListCollection(),
   connull());
It is not possible to convert this code to c#, kernel functions like querystr and classnum do not exist in the .Net connector, but perhaps some other clever developer has an solution for this.
XSL translation from XML to HTML.


 

   
   
   
   
  
      
     
      
      
     
         
        

        
            

            
           
            
            

            
           
            
            

            
           
            
            

            
           
            
            

            

            
           
               
              
                  
                   n1:CommissAmountMST
                  
              
              
SKIP BIG PART OF XSLT
.
.
.
SKIP BIG PART OF XSLT
 
           
                  
                  
                  
                  
                     
                  
                  
              
               
           
            
            

            

        
        

         
         

     
      
  
   

 
The HTM result. ( It is  not spectacular, it just shows you, it will work J)
Light and Design
1234 Elm Street Los Angeles, CA 90011 US
00001_013


n1:CommissAmountMST
n1:CurrencyCode
n1:CustomerLineNum
n1:ItemId
n1:ItemName
n1:LineAmountMST
n1:LineAmountTaxMST
n1:LineNum
n1:Name
n1:Qty
n1:SalesId
n1:SalesUnit
n1:TaxAmountMST
USD
6000.00
1.0000000000
Sale of plant equipment
1.00



L.A. County School Purchase Association
567 Government Plaza Los Angeles, CA 90086 US
00001_043
00319_036
n1:CommissAmountMST
n1:CurrencyCode
n1:CustomerLineNum
n1:ItemId
n1:ItemName
n1:LineAmountMST
n1:LineAmountTaxMST
n1:LineNum
n1:Name
n1:Qty
n1:SalesId
n1:SalesUnit
n1:TaxAmountMST
-168.60
USD
CN-01
Chrome architect Lamp
-1440.00
Chrome architect Lamp
-3.00
00319_036
Pcs
 
 
So wrap up:
1.      CRM connect to AX (.net client).
2.      Call the AIF base framework.
3.      AX response with XML file
4.      convert is from XML to HTML with XSLT and MS CRM will show the page.
 


Источник: http://axstart.spaces.live.com/Blog/...C0A0!359.entry
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Dynamics AX: Managing Your Supply Chain Using Microsoft Dynamics AX 2009 - Book Review Blog bot DAX Blogs 0 31.03.2009 23:06
Dynamics AX: Microsoft's strategy and vision for Dynamics AX and SOA Blog bot DAX Blogs 0 05.03.2009 18:05
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
Inside Dynamics AX 4.0: Usage Scenarios Blog bot DAX Blogs 0 04.10.2007 05:15

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 05:03.