public class ReportRun extends ObjectRun //1st Method
{
ItemId itemid;
InventLocationId inventlocationId;
InventColorId inventcolorId;
InventSizeId inventsizeId;
Date mfdDate;
str name;
DialogField dialogItemId;
DialogField dialogInventlocationId;
DialogField dialoginventcolorId;
DialogField dialoginventsizeId;
DialogField dialogMfdDate;
InventTable _inventTable2;
#DEFINE.CurrentVersion(1)
#LOCALMACRO.CurrentList
itemId,
inventlocationId,
inventcolorId,
inventsizeId,
mfdDate
#ENDMACRO
}
public Object dialog(Object _dialog) // 2 nd Method
{
DialogRunBase dialog = _dialog;
;
dialogItemId = dialog.addFieldValue(typeid(ItemId), itemId, ‘Item Id’);
dialogInventLocationId = dialog.addFieldValue(typeid(InventLocationId), inventlocationId, ‘Factory’);
dialogInventColorId = dialog.addFieldValue(typeid(InventColorId), inventcolorId, ‘Color’);
dialogInventSizeId = dialog.addFieldValue(typeid(InventSizeId), inventsizeId, ‘Size’);
dialogMfdDate = dialog.addFieldValue(typeid(Transdate), mfdDate, ‘MFD date’);
return dialog;
}
public boolean getFromDialog() //3rd method
{
;
itemid = dialogItemId.value();
inventSizeid = dialoginventSizeid.value();
inventcolorid = dialoginventcolorid.value();
mfdDate = dialogmfdDate.value();
return true;
}
now i want to create a lookup suck type whenever someone type a Item Id in dialog field box then the size and colour list belongs to that item Id appears on ''size and colour dialog field ‘’
kindly reply me Asap 
waiting for solution …Thanx in Advance 
That wont be possible in report dialog. instead you can take a form and use modified method or else use normal dialog and can use method dialog.allowUpdateOnSelectCtrl(true);
Hi Pratham, You need this in AX 2009 or AX 2012?? If it is in AX 2012, then yes one lookup can be based on the another lookup for a report dialog. In your case, the size and color can be there as according to the ItemID. Thanks, Preeti
Hi Pratham, You need this in AX 2009 or AX 2012?? If it is in AX 2012, then yes one lookup can be based on the another lookup for a report dialog. In your case, the size and color can be there as according to the ItemID. Thanks, Preeti
Hello Pratham,
Below is the example - When ItemGroupId is seelcted basiing on the itemgroupid related ItemId belongs to that groupid is shown in the itemid lookup.Below is the code…
Exportfile for AOT version 1.0 or later
Formatversion: 1
***Element: CLS
; Microsoft Dynamics AX Class: Test unloaded
; --------------------------------------------------------------------------------
CLSVERSION 1
CLASS #Test
PROPERTIES
Name #Test
Extends #RunBase
RunOn #Called from
ENDPROPERTIES
METHODS
Version: 3
SOURCE #Fld2_1_Lookup
#public void Fld2_1_Lookup()
#{
SysTableLookup sysTableLookup;
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
Query query;
FormStringControl _control;
;
sysTableLookup = SysTableLookup::newParameters(tablenum(InventTable),dialogItemId.control());
sysTableLookup.addLookupfield(fieldnum(InventTable, ItemId));
sysTableLookup.addLookupfield(fieldnum(InventTable, ItemName));
sysTableLookup.addLookupfield(fieldnum(InventTable, ItemGroupId));
sysTableLookup.addLookupfield(fieldnum(InventTable, itemType));
query = new Query();
queryBuildDataSource = query.addDataSource(tablenum(InventTable));
queryBuildRange = queryBuildDataSource.addRange(fieldnum(InventTable, ItemGroupId));
queryBuildRange.value(dialogItemGroupId.value());
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
#}
ENDSOURCE
SOURCE #main
#public static void main(Args args)
#{
Test test;
;
test = new Test();
if(test.prompt())
{
test.run();
}
#}
ENDSOURCE
SOURCE #dialogPostRun
#public void dialogPostRun(DialogRunbase dialog)
#{
super(dialog);
dialog.formRun().controlMethodOverload(true);
dialog.formRun().controlMethodOverloadObject(this);
#}
ENDSOURCE
SOURCE #unpack
#public boolean unpack(container packedClass)
#{
boolean ret;
ret = super(packedClass);
return ret;
#}
ENDSOURCE
SOURCE #pack
#public container pack()
#{
container ret;
ret = super();
return ret;
#}
ENDSOURCE
SOURCE #getFromDialog
#public boolean getFromDialog()
#{
boolean ret;
ret = super();
itemGroup = dialogItemGroupId.value();
itemId = dialogItemId.value();
return ret;
#}
ENDSOURCE
SOURCE #dialog
#public Object dialog()
#{
DialogRunbase dialog;
;
dialog = new DialogRunbase("@SYS68260", this);
dialogItemGroupId = dialog.addFieldValue(typeid(ItemGroupId),itemGroup,“Item Group”);
dialogItemId = dialog.addFieldValue(typeid(ItemId),itemId,“Item Id”);
return dialog;
#}
ENDSOURCE
SOURCE #classDeclaration
#class Test extends Runbase
#{
DialogField dialogItemGroupId;
DialogField dialogItemId;
ItemGroupId itemGroup;
ItemId itemId;
#}
ENDSOURCE
ENDMETHODS
ENDCLASS
***Element: END
Similiraly apply for the above case.
Hi kranthi,
where i will write that Fld2_1_lookup() ?I am not finding any override lookup method
if this is a new method to be created then how it will be called as lookup ?