Applied on: Ax 2009 SP1
Prerequisite:
- You should have Dynamics Ax 2009 SP1 installed with Enterprise Portal
- Visual Studio 2008 should be installed.
- You should have basic knowledge of Dynamics Ax, Visual Studio, X++ and C#
- You should have knowledge of previous version Dynamics Ax Enterprise Portal
This article explains:
- How to convert Microsoft Dynamics Ax Web form to use ASP.Net-based framework for Ax Enterprise Portal.
- How to use the Web Form Converter class.
- How to convert Enterprise Portal Content.
- How to convert a Web form to user control.
User Controls created by using this framework are the primary method for adding functionality to Enterprise Portal. Visual Studio is used to develop or customize User Controls.
In earlier versions of Dynamics AX Enterprise Portal, Web forms and Web controls were the primary method to provide functionality. While Web forms and Web controls are still supported, but Microsoft recommends that any new development for Ax Enterprise Portal to be done with Visual Studio and the ASP.NET-based framework.
If you have created Web forms for an earlier version of Dynamics AX Enterprise Portal, you can convert them to use the new ASP.NET-based framework. A Web Form Converter class is available that can take an existing Web form and convert it into components that can be used with the new Enterprise Portal framework.
To convert a Web form to use the ASP.NET-based framework for Enterprise Portal, you must first add the SysEPWebFormConverter class to your Microsoft Dynamics AX installation. Then you will use methods in this class to perform the conversion.
The SysEPWebFomConverter class contains several methods that are used when you convert a Web form from an earlier version of Enterprise Portal to the components used with the ASP.NET-based framework. You can find the codes of this class from MSDN or you can download the XPO of this class from here. Download this zip file and extract it. Import the extracted XPO file to your application [Note: Applied on Ax 2009 SP1].
To add the SysEPWebFormConverter class
- If you use the MSDN code then instructions are there how to do it.
- If you download the above said zip file then extract the zip file.
- Open your Microsoft Dynamics AX application, open the AOT.
- Click the Import button to open the Import form.
- Click Browse and select the SharedProject_SysEPWebFomConverter.xpo file that you extracted.
- Click OK to start the import process. The class will be added to the AOT.
To use the Web Form Converter class, you will specify which Web forms you want to convert.
- In the AOT, expand the Classes node.
- Locate the SysEPWebFormConverter class. Expand the node for this class.
- Right-click the getFormsToConvert method for the class, and then click Edit.
- In the script for this method, specify the Web forms that you want to convert. Replace WebForm1 and WebForm2 with the names of the Web forms to be converted. If necessary, add more lines for additional Web forms.
- Click Save to save the changes.
- In the AOT, right-click the main method for the class, and then click Edit. This is the main code that performs the conversion. It retrieves the list of Web forms to convert, performs the conversion, and then adds the resources that were created to a new project.
- Specify the name of the project to be created. By default, the project created will be named WebForm_Conversion. You can change this name if needed.
- Click Save to save any changes to the script.
- Right-click on the SysEPWebFormConverter class and click on Open to perform the conversion. The new project will be displayed that contains the new resources that were created.
- To use the new Web Controls that were created, you must deploy them to the Enterprise Portal server. In the AOT, expand the Web node, and then expand the Web Files node. Right-click the Web Controls node, and then click Deploy.
- After the conversion is complete, you should verify that the new components are working correctly.
To view a new User Control in Enterprise Portal, add a Dynamics User Control Web part to an Enterprise Portal page as add Dynamics Web Form Web part. Select the new User Control as the managed content item to display.
To view a User Control in Visual Studio, create a new project as described below:
- Start Visual Studio.
- In the File menu, click New, and then click Web Site.
- In the New Web Site window, select .NET Framework 2.0 as the framework version to use.
- Set the Location to File System and the Language to Visual C#.
- Choose Dynamics AX Web Project as the template to use. If you do not see this project template, be sure that you have the Enterprise Portal Tools installed.
- Specify the name and location of the folder where you want to store the files for the Web project.
- Click OK to create the Web project.
- If a dialog box displays asking whether to upgrade the Web site to the .NET Framework version 3.5, click No.
- The Web Form Converter provides a starting point for converting Web forms to User Controls for Ax Enterprise Portal. You may have to use Visual Studio to modify the User Controls that were created by the conversion to achieve the results that you want.
I will post in a separate article how to modify a user control for Ax Enterprise Portal.
Hi, I've got a problem when I try to edit and Web User Control that has been converted by this converter. When I try to add it in the VS from the AOT, the web user control doesn´t appear. The others web control created directly from VS do'esnt appear either. I have tested it in 2.0 Framework and in 3.5.
ReplyDelete