Dynamics Search Engine

Thursday, January 22, 2009

How to browse or open a table in Microsoft Dynamics Ax by using X++ language

Note: There is no warranty on this article, use at your own risk.
This article explains:
How to browse a table runtime in Microsoft Dynamics Ax
How to browse a table using x++ language in Microsoft Dynamics Ax
How to browse a table programatically in Microsoft Dynamics Ax
How to open a Microsoft Dynamics Ax table by using X++ codes

Requirement: You should be familiar with Dynamics Ax basic programming.

Open your Ax application then AOT.

Go to Jobs node and create a new job.
Copy the below code and paste it to your job. Here I renamed the job to BrowseTable.

I applied it on Ax 3.0

static void BrowseTable(Args _args)
{
SysTableBrowser systabB;
;
systabB = new SysTableBrowser();
systabB.run(tablenum(inventtable));
}

Monday, January 19, 2009

How to convert Microsoft Dynamics Ax Web form to use ASP.Net-based framework for Ax Enterprise Portal

Disclaimer: There is no warranty for this article. Use at your own risk.
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.
Enterprise Portal for Microsoft Dynamics AX 2009 uses a new framework based on ASP.NET.
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
  1. If you use the MSDN code then instructions are there how to do it.
  2. If you download the above said zip file then extract the zip file.
  3. Open your Microsoft Dynamics AX application, open the AOT.
  4. Click the Import button to open the Import form.
  5. Click Browse and select the SharedProject_SysEPWebFomConverter.xpo file that you extracted.
  6. Click OK to start the import process. The class will be added to the AOT.
How to using the Web Form Converter Class
To use the Web Form Converter class, you will specify which Web forms you want to convert.
  1. In the AOT, expand the Classes node.
  2. Locate the SysEPWebFormConverter class. Expand the node for this class.
  3. Right-click the getFormsToConvert method for the class, and then click Edit.
  4. 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.
  5. Click Save to save the changes.
  6. 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.
  7. 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.
  8. Click Save to save any changes to the script.
  9. 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.
  10. 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.
  11. 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:
  1. Start Visual Studio.
  2. In the File menu, click New, and then click Web Site.
  3. In the New Web Site window, select .NET Framework 2.0 as the framework version to use.
  4. Set the Location to File System and the Language to Visual C#.
  5. 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.
  6. Specify the name and location of the folder where you want to store the files for the Web project.
  7. Click OK to create the Web project.
  8. If a dialog box displays asking whether to upgrade the Web site to the .NET Framework version 3.5, click No.
  9. 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.
Hope this article is helpful for you.
I will post in a separate article how to modify a user control for Ax Enterprise Portal.

Wednesday, January 14, 2009

How to create, assign and use Cues for Role Center in Microsoft Dynamics Ax 2009

Disclaimer: There is no warranty for this article. Use at your own risk.

This article describes:

How to customize a Role Center in Microsoft Dynamics Ax 2009
How to create Cues for a Role Center in Microsoft Dynamics Ax 2009
How to assign Cues for a Role Center in Microsoft Dynamics Ax 2009

How to use Cues for a Role Center in Microsoft Dynamics Ax 2009


Prerequisite
You should have Microsoft Dynamics Ax 2009 installed with Role Center.
You should have basic knowledge of Microsoft Dynamics Ax 2009 technically & functionally.
Overview
The Cues Web part shows a pictorial representation of an important number for a business for example; the number of open sales orders.

Create a Cue step by step
I have a fresh installed Ax 2009 with Role Center as shown below where no Cue is available.



Now go to Main menus > open the Purchase Order Details form and filter is by purchase order status Open order as shown below
Press Ctrl + F3 to create a query.


Here you can specify your filter criteria. By default the purchase orders are filtered by Open order status
because I have done it on Purchase Order Details form.

Click on Modify menu button then Save as Cue...


If you click on Save as Cue…, you will get the below form


In the Cue Id field give a name [I have given a name TestCue]. In the Caption filed give a caption. You can create a label Id for the caption.
From Security group select Everyone radio button so that every user can see the cue you are going to create.
Click on OK button. The will be closed.
Now click on OK button on Query form.
To verify the Cue has been created or not go to Main menu > Basic > Setup > Role Center > Edit Cues.
On this form your Cue should be available.
I hope your Cue has been created successfully.


Assign Cue to Cue web part step by step

Go the Main menu then Home.

In the Role Center click on the downward arrow symbol on Cues web part then Modify Shared Web Part as shown below:




This will give the GUI like:



Select your cue from the dropdown Select a Cue to Modify. By default Cue 1 is selected, you can go with Cue 1.
From View dropdown select the View (Cue) you created, I created TestCue.

You can configure few more range like Count, Threshold, and Total but those are not necessary now.
Click on Apply button. Click on OK button.
See the Cue has been added for purchase order with Status Open order to the Cues Web Part as shown below:



If you click on the Cue icon the Purchase Order Details form will open with all the Open order.

Cheers!

Tuesday, January 6, 2009

When you click the ellipsis button in the URL property of AOT URL in Microsoft Dynamics AX 4.0: Error message you get "Error in URL property error"

When you work on Microsoft Dynamics AX 4.0 Enterprise Portal, sometimes you get/receive an error message 'Error in URL property error' or 'Error: Development site is not found in the EPParameters table' in the infolog dialog box, if you click the ellipsis (...) button in the URL property of an URL in the Application Object Tree (AOT).

This problem occurs if the URL is used for the enterprise portal.
Actually there would be a web folder issue on the IIS server. To get out of this issue, a knowledge base article 'Software Update for Web Folders (KB907306)' is available on Microsoft website. To download this click here.

In the above mentioned article there is a small downloadable software which you need to download and install to the Microsoft Internet Information Service (IIS) server for the AOT. Install this software to the IIS client computers for the AOT.

Restart the systems you updated and try.

Monday, January 5, 2009

How to use HTML Editor or HTML syntax composer in Microsoft Dynamics Ax or Axapta

Disclaimer: There is no warranty on this article. Use at your own risk.

Applied on: Dynamics Ax 4.0

Pre-requisites: You should have X++ programming knowledge


This article explains:

How to use HTML Editor or HTML syntax composer in Microsoft Dynamics Ax or Axapta.

How to publish Job ads in html format.


Some times you need a solution where html editor or html syntax composer is required to avoid the wrong inputs from the user. So your solution is here.

Dynamics Ax has this feature but if you are not aware of it then … :)


Go to the
HRM main menu then open Recruitment projects form. On this form there is button called Job ads. Click on this button.






It will open the Job ads form where data will be displayed wrapped by an html control on the form as shown below.


If you click the Edit button on the Job ads form it will open the HTML editor as shown below.


Click on the HTML tab to see the text with html tags.


To open the HTML editor programmatically you need to use 'CCHTMLEditor' class.

Lets say you have a button and on click event of the button you want to call the HTML editor; so your code goes like:


void clicked()

{

CCHTMLEditor CCHTMLEditor;

HRMRecruitingJobAd hrmRecruitingJobAd;

;

super();

ccHTMLEditor = new CCHTMLEditor(‘Your table name’,

fieldNum([Your Table name], [Field name of your table]),

element,

[Name of the HTML control]);

ccHTMLEditor.run();

}



Your table field should be extended to CCHTMLString EDT as shown above.

Friday, January 2, 2009

Dynamics Ax 4.0 Enterprise Portal--Windows SharePoint Services does not display the Enterprise Portal templates on the Custom tab.

Disclaimer: There is no warranty on this article. Use at your own risk.

This article is useful:
When the Enterprise Portal templates are not displayed even you deploy the Enterprise Portal software in the Microsoft Dynamics AX 4.0 client.

Windows SharePoint Services does not display the Enterprise Portal templates on the Custom tab.
You don’t receive the message 'DeploySiteDefinition:Success' on Update using Manage Deployments Form.

Cause:

Generally this problem occurs when the current user account does not have access to the file location.
May be Windows SharePoint Services 2.0 and Windows SharePoint Services 3.0 both are installed on the server.
May be the Windows SharePoint Services 3.0 is installed with an additional language package.

To solve this problem

1) you need to download a knowledge base update from Microsoft website. To download this extranet/partnersourse access is required.
Click here to down load.

2) Save the down loaded file in the 1033 folder of your installed WSS:

The location would be
[Root drive:]\ProgramFiles\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033

3) Extract the down loaded file, and then copy the Webtempaxsitedef.xml file to the folders below:
[Root drive:]\ProgramFiles\Common Files\Microsoft Shared\Web server extensions\12\TEMPLATE\SiteTemplates\XML
[Root drive:]\ProgramFiles\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML

4) Open the Ax Application then press Ctrl + D to open the AOT.

5) Go to Web node then Web Files, click on Site Definitions, and then locate the site definition file for the language that is installed. For example, the site definition file for US-EN is AxSiteDef_1033_xip.


6) Right-click the site definition file, and then click Deploy.

7) Restart the IIS.


Now it should work.
For more information you can visit Microsoft website extranet/partnersourse access is required.