I was working with multiselect lookup so i don't know how to work with that so i tried this code in UIBuilder class but was not showing ItemId related to selected ItemGroup.
public void postRun()
{
QueryBuildDataSource qbds;
QueryBuildRange qbr;
str curCompany;
curCompany = curExt();
Query query3 = new Query();
qbds = query3.addDataSource(tableNum(InventItemGroupItem));
qbds.addGroupByField(fieldNum(InventItemGroupItem,ItemGroupId));
qbr = qbds.addRange(fieldNum(InventItemGroupItem, ItemGroupDataAreaId));
qbr.value(curCompany);
container selecteditemgroup = [tableNum(InventItemGroupItem), fieldNum(InventItemGroupItem, ItemGroupId)];
SysLookupMultiSelectCtrl::constructWithQuery(this.dialog().dialogForm().formRun(),dialogitemGroup.control(),query3, true, selecteditemgroup);
Query query4 = new Query();
QueryBuildDataSource qbdss;
int i ;
qbdss = query4.addDataSource(tableNum(InventItemGroupItem));
qbr=qbdss.addRange(fieldNum(InventItemGroupItem, ItemGroupDataAreaId));
qbr.value(curCompany);
if (conLen(selecteditemgroup) > 0)
{
qbr = qbdss.addRange(fieldNum(InventItemGroupItem, ItemGroupId));
str rangeValue = '';
for (i = 1; i <= conLen(selecteditemgroup); i++)
{
if (i > 1)
{
rangeValue += ',';
}
rangeValue += conPeek(selecteditemgroup, i);
}
qbr.value(rangeValue);
}
container selecteditemId = [tableNum(InventItemGroupItem), fieldNum(InventItemGroupItem, ItemId)];
SysLookupMultiSelectCtrl::constructWithQuery(this.dialog().dialogForm().formRun(),dialogitemId.control(),query4, true, selecteditemId);
}