.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

Enjoyyyyy !!!!!!!!!!

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.