Proxies If you need to call X++ classes, table methods, or enumerations in your web user control, the Enterprise Portal framework provides an easy way to create a managed wrapper for these X++ objects and use it in your web user control. A proxy file internally wraps the Microsoft .NET Business Connector calls and provides a simple, easy-to-use, typed interface for C# applications.
Creating a new proxy project 1.
Start Visual Studio, and click File > New Project.
2.
In the project types window, select Visual C#.
3.
In the Visual Studio installed templates section, select Class Library.
4.
Click File > Add <project name> to Dynamics AX.
5.
In Solution Explorer, select the project, and set the Deploy to EP property of the project to Proxies.
Note Setting Deploy to EP to Yes will deploy the Enterprise Portal as an assembly. For a proxy project, we recommend that you set it to Proxies. 6.
In Solution Explorer, right-click the project, click Properties, and then set the Default namespace property to Microsoft.Dynamics.Portal.Application.Proxy.
7.
Delete the Class1.cs file that comes with the ClassLibrary project.
8.
Click View > Application Explorer, right-click the object for which you need a proxy, such as tables, EDTs, enums, or classes, and then click Add to Project.
9.
Save this project, and then add a reference to this project in your Enterprise Portal web control project.
10. In your web control, add a reference to the Microsoft.Dynamics.Portal.Application.Proxy namespace, and start using proxies.
135