Dialog field object is not initialized

I am trying to use Dialog in the report. I am getting an error that Dialog field object is not initialized… I am using the code given below:

public Object dialog(DialogRunbase _dialog = null)
{
DialogRunBase dialognew;
;
//breakpoint;
dialognew = super(_dialog);
dialognew.caption(“Print Details”);
dialognew.allowUpdateOnSelectCtrl(true);
dialogID = dialognew.addField(typeid(PurchName),“Purchase Name”);
dialogVendorAccount = dialognew.addField(typeid(PurchIdBase),“Purchase ID”);

// dialogID.allowEdit(false);
return dialognew;
}

The error is thrown in the fetch method:

public boolean fetch()
{
PurchTable _PurchTable;
PurchLine _PurchLine;
boolean ret;
;
select _PurchTable join _PurchLine where _PurchTable.PurchId && _PurchLine.PurchId == dialogID.value();

ret = super();

return ret;
}

Please help me to clear this error

is this related to NAV?

No…Dynamics Ax 2009

Then, by mistake you posted it in NAV forum, move it to AX forum for quick replies.

Yup…I moved

[:)] . Thank you very much for your time