Thursday, May 24, 2012

.NET Proxies (Alternative to .NET Business Connector) in Dynamics AX 2012

If you recall in older versions of dynamics ax, .NET Business connector is used to integrate Microsoft applications with dynamics ax.
In Dynamics AX 2012 , they come up with an alternative to .NET Business connector called as .NET Proxy classes, which in-turn use .NET Business Connector to communicate with AOS.

Basically .NET Proxy class provides access to X++ Table, Class and Enum objects only.
Advantage of .NET Proxy class
  •  Proxies require an early-bound programming model. The early-bound model enables the code editor to provide IntelliSense.

Following example try to illustrate the same, (Referring Contoso Entertainment Demo data, CEU Company) 

Step 1 :  
              Open Visual studio 2010.
Step 2 :  
               Create C# Console application project.   

Step 3 :  
               Add the project to AOT as below



Step 4 :  
                Generate proxy for table custTable, by adding to object to Project as below,



Step 5 : 
                Add reference "Microsoft.Dynamics.AX.ManagedInterop" to your project from         C:\..\AX60\Client\Bin Folder.

      
Step 6 : 
                Finally use the below code to print all the records from CustTable to console.



Step 7 : When you build project, will see the output as below

1 comment:

ANDRAINO ADAMS said...

Good articles, Have you heard of Mr Benjamin, Email: 247officedept@gmail.com --WhatsApp Contact:+1-9893943740-- who work with funding service they grant me loan of $95,000.00 to launch my business and I have been paying them annually for two years now and I still have 2 years left although I enjoy working with them because they are genuine Loan lender who can give you any kind of loan.

How to identify the user that was used to change an object from AOT in AX2012

Get the object name for which we need to track these (user and date&time) information's. Login to SQL Server Management Studio an...