My 2p about ERP Solutions, Information Worker Solutions and other software products (mainly Microsoft Dynamics AX and Microsoft SharePoint).

19 July 2009

Dynamic dialogs for Microsoft Dynamics AX reports

by Patrik Luca 1 comments

Tag



Introduction: dynamic dialogs

This post shows how to make dynamic dialogs for Microsoft Dynamics AX reports. To illustrate this, I elaborated an example based on a standard Microsoft Dynamics AX report which can be found in the Human Resources module by following this path: Human Resources > Reports > Status lists > Absence status.

Purpose of this dynamic dialog is to fill in automatically the End date with a value equal to the end of the month of the entered value for the Start date.

Solution: dialogSelectCtrl method

Go to the class HRMAbsenceStatusListPrint, which is the class related to the Absence status report used in this example.

Add a new method called dialogSelectCtrl, which looks like this:

public void dialogSelectCtrl() 

{

;

super();

// get the value entered by the
// end-user for the startDate
startDate = dialogStartDate.value();

// only set the a value if the endDate
// doesn’t have a value yet
if(startDate && !dialogEndDate.value())
{
// set automatically the endDate equal to the end
// of the month of the entered value by the end-user
dialogEndDate.value(EndMth(startDate));
}

}


Edit the existing dialog method and add following line just before the return dialog line to call the logic implemented in the dialogSelectCtrl method:



public Object dialog()
{
// call the dialogSelectCtrl method when a control is selected
dialog.allowUpdateOnSelectCtrl(true);
return dialog;
}

Comments 1 comments
redstar7 said...

Very nice, thank you!

Patrik Luca, Ieper, BELGIUM
Feel free to use or spread all of the content on my blog. In return, linking back to my blog would be greatly appreciated. All my posts and articles are provided "AS IS" with no warranties.

Subscribe feeds via e-mail
Subscribe in your preferred RSS reader

Subscribe feeds rss Most Read Entries

Subscribe feeds rss Recent Entries

Categories

Recommended Books


Subscribe feeds rss Recent Comments

This Blog is part of the U Comment I Follow movement in blogosphere. Means the comment field of this blog is made DOFOLLOW. Spam wont be tolerated.

Live Traffic Feed

Recent Visitors

Blog Archive

My Blog List

Followers

Guest Links