I have created Detail Transaction Form. In which I have added multi select lookup but issue is when i open lookup or press ok button of lookup Dynamics Ax 2012 forcedly close.
I am aware of Detail Transaction Form's grid behavior that it by default insert record in table but what I want is that grid create numbers of record in table according to the number of selected value of multi select lookup.
Here is the lookup code below:
public void lookup()
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup;
str ItemCategoryCodeforlockup = RNI_SchemeLinesDetailTable_Product.valueStr();
sysTableLookup = SysTableLookup::newParameters(tableNum(SL_ItemCatSubType), this);
queryBuildDataSource = query.addDataSource(tableNum(SL_ItemCatSubType));
queryBuildDataSource.addRange(fieldNum(SL_ItemCatSubType,RNI_LINEOFPRODDESCRIPTION)).value(ItemCategoryCodeforlockup);
sysTableLookup.parmQuery(query);
sysTableLookup.addLookupField(fieldNum(SL_ItemCatSubType, Description));
sysTableLookup.addLookupField(fieldNum(SL_ItemCatSubType, Itemcategorycode));
sysTableLookup.performFormLookup();
msCtrl = SysLookupMultiSelectCtrl::constructWithQuery(this.formRun(),this,query);
}
public boolean modified()
{
boolean ret;
container c,v;
int i;
ret = super();
if (ret)
{
c = msCtrl.get(); // get RecIds of the selected rows
v = msCtrl.getSelectedFieldValues(); // get actual value of the selected rows
for (i = 1; i <= conLen(c);i )
{
//info(conPeek(c,i));
//info(conPeek(v,i));
}
}
return ret;
}
Below is the error screen shots