Lookup Field doesn't work after first selection AX 2009


I have created a lookup field on a string method,also a modified query which only calls the executeQuery which I created in one of the form datasource.The lookup works only for the first selection and then it goes non editable and doesn’t show values.It looks something like this after first selection:


check the field property, edit property can be NO, and you are able to select on first time becasue it can be Edit on create can be true.

or it is some code mistake which you can check thru debugger

The field property is ok,the code in lookup also,excuteQuery works fine through debugger.I don’t know what it might be

If editing is no disabled by the property, it’s done by some code.

In either case, it has nothing to do with the lookup.

Query query = new Query();

QueryBuildDataSource queryBuildDataSource;

QueryBuildRange queryBuildRange;

SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(InventTable),this);


sysTableLookup.addLookupField(fieldNum(InventTable, field),true);

queryBuildDataSource = query.addDataSource(tableNum(InventTable));

queryBuildRange= queryBuildDataSource.addRange(fieldnum(InventTable, field));




This is the normal lookup code.Am i forgetting someting in here?

It has nothing to with your lookup. The code of your lookup is not relevant to your problem. Ignore the lookup and start looking at why the field is not editable. We already gave you several leads.

you can check the group in which this field is, try to check if auto declaration property, if it is YES, then try to find the name of your control in the code which will give you exact place where it is being non editable.

Actually it was non editable in the base table,but the error continues