Dialog usage in reports.

One of the frequently asked question by the New AX users..
For all those people i am suggesting you to declare 2 dialog fields.
and two variables to fetch the values from dialog, based on the return type.. in the class declaration in the report.
and writ below code in respective methods if you are creating a dialog with two date fields from date and to date.
If You are creating a dialog follow the same process.. as below..

public class ReportRun extends ObjectRun
dialogField Fromdatefield,todatefield;
FromDate fromdatevalue;
ToDate todatevalue;
date1980 date1;
date1980 date2;
ConfirmId ConfirmIdfield;


display date1980 date2()
return date2;

display date1980 date1()
return date1;
public boolean getFromDialog()
Boolean ret;
// LedgerPeriod ledgerPeriod;
// CustConfirmTrans CustConfirmTrans;

fromDateValue = fromDateField.value();
toDateValue = toDateField.value();

if (fromDateValue == dateNull())
select firstonly CustConfirmTrans;
fromDateValue = CustConfirmTrans.ConfirmDate;//.PeriodStart;
if (toDateValue == dateNull())
todateValue = systemDateGet();
if (fromDateValue > toDateValue)
ret = checkFailed(‘From date should not be greater than To date.’);
ret = true;

return ret;

public Object dialog(Object d)

DialogRunbase dialog = d ;

fromDateField = dialog.addField(typeid(FromDate),”From date”);
toDateField = dialog.addField(typeid(ToDate),”To date”);

return dialog;

public boolean fetch()
boolean ret;
// CustConfirmJour dsCustConfirmJour;
date1 = fromdatevalue;
date2 = todatevalue;

while select CustConfirmTrans where CustConfirmTrans.ConfirmDate >= fromdatevalue
&& CustConfirmTrans.ConfirmDate <= todatevalue


ret = true; //super();

return ret;


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s