Hi ,
I am trying to Multi Select the Item Group , I can able to multi select too . When I tried degugging I can able to see the List of Group ID inside the contract class(List return type parm method) untill I press the ok Button in the Dialog Form . When I press the ok button and while clalling the parm method(List Reurn Type) from the DP class I am able to sore only the first value in the varaible .
Here is my code .
Contract class
[ DataContractAttribute, SysOperationContractProcessingAttribute(classStr(ItemSummaryUIBuilder), SysOperationDataContractProcessingMode::CreateUIBuilderForRootContractOnly) ] class ItemSummaryContract implements SysOperationValidatable { List itemGroupId; [ DataMemberAttribute('ItemGroup'), SysOperationLabelAttribute(literalStr("Item Group")), AifCollectionTypeAttribute("Item Group", Types::String), SysOperationDisplayOrderAttribute("3") ] public List parmItemGroup(List _itemGroupId = itemGroupId) { itemGroupId =_itemGroupId; return itemGroupId; } }
UI Builder class
public class ItemSummaryUIBuilder extends SrsReportDataContractUIBuilder { ItemSummaryContract contract; DialogField itemGroupID; List itemGroupIDList; public void postBuild() { contract = this.dataContractObject() as ItemSummaryContract; itemGroupID= this.bindInfo().getDialogField(contract, methodStr(ItemSummaryContract, parmItemGroup)); itemGroupID.registerOverrideMethod(methodStr(FormStringControl,lookup),methodStr(ItemSummaryUIBuilder,ItemGroupLookup),this); } public void postRun() { // this.GroupID(); } private void ItemGroupLookup(FormStringControl _control) { ListEnumerator enum; Query query = new query(); QueryBuildDataSource queryBuildDataSource; queryBuildDataSource = query.addDataSource(tableNum(InventItemGroup)); queryBuildDataSource.fields().dynamic(false); queryBuildDataSource.fields().clearFieldList(); queryBuildDataSource.addSelectionField(fieldNum(InventItemGroup, ItemGroupId)); SysLookupMultiSelectGrid::lookup(query,_control, _control, _control, conNull()); } }
DP class
[SRSReportParameterAttribute(classStr(ItemSummaryContract))] class ItemSummaryDpClass extends SRSReportDataProviderBase { ItemSummaryTemptbl itemwiseTmp; ListEnumerator itemGroupIdIterator; // List _itemGroupId; List _itemGroupId = new List(Types::String); ItemSummaryContract contract; TransDate fromDate; TransDate toDate; InventLocationId inventLocationId; InventSiteId inventSiteId; WMSLocationId locationId; ItemGroupId itemGroupId; ItemId itemId; [SrsReportDataSetAttribute(tableStr(ItemSummaryTemptbl))] public ItemSummaryTemptbl getPurchaseOrderTmp() { select itemwiseTmp; return itemwiseTmp; } public void processReport() { InventTable inventTable; InventTrans inventTrans; InventDim inventDim; InventTransOrigin inventTransorigin; InventTransferTable inventTransferTable; InventTransferJour inventTransferJour; InventItemGroupItem inventItemGroupItem; CompanyInfo companyinfo; real openingPurchQty,openingSoldQty,openingPurchvalue,openingSoldValue; contract = this.parmDataContract() as ABS_ItemSummaryContract; //Assigning contract values to Parameters fromDate = contract.parmFromDate(); toDate = contract.parmToDate(); inventLocationId = contract.parminventLocationId(); inventSiteId = contract.parminventSiteId(); //itemGroupId = contract.parmItemGroup(); _itemGroupId = contract.parmItemGroup(); locationId = contract.parmloationId(); select * from companyinfo where companyinfo.DataArea == curext(); itemwiseTmp.CompanyName = companyinfo.Name; if (_itemGroupId != null) { itemGroupIdIterator = _itemGroupId.getEnumerator(); while (itemGroupIdIterator.moveNext()) { itemGroupId = itemGroupIdIterator.current(); while select inventItemGroupItem where inventItemGroupItem.ItemGroupId == itemGroupId join inventTable where inventTable.ItemId == inventItemGroupItem.ItemId { itemwiseTmp.ItemId = inventTable.ItemId; itemwiseTmp.ItemGroupId = inventItemGroupItem.ItemGroupId; itemwiseTmp.Description = InventTable::find(inventTable.ItemId).itemName(); itemwiseTmp.UOM = InventTableModule::find(inventTable.ItemId,ModuleInventPurchSales::Invent).UnitId; itemwiseTmp.insert(); } } } }
I have not mentioned the controller class here .
While debugging the DP class I can able to fetch only one record inside this _itemGroupId (List type variable)
the following line inside the DP class ..Since I am getting only one value There is no use of iterating . I dont know where I am commiting the mistake ? Can someone please help me in this ?
_itemGroupId = contract.parmItemGroup();