1. ลาก Table InventTable ไปเป็น Data Sources แล้วกำหนด Properties
JoinSource : InventSum
LinkType : InnerJoin
2. แก้ Classes InventDimCtrl_Frm_OnHand
Method : modifyQuery
- FormDataSource InventTable_DS
- ;
- QueryBuildDataSource qbsInventLookup;
- if(InventTable_DS)
- {
- qbsInventLookup = query.dataSourceName(InventTable_DS.name());
- //filter current company language
- /*qbr = SysQuery::findOrCreateRange(qbsInventLookup, fieldnum(TIDInventLookup, LanguageId));
- qbr.value(queryValue(CompanyInfo::languageId()));
- */
- //qbsInventLookup.addGroupByField(fieldNum(SCI_InventSumLookUp, ItemName));
- //qbsInventLookup.addGroupByField(fieldNum(TIDInventLookup,NameAlias));
- //qbsInventLookup.addDataSource(fieldNum(SCI_InventSumLookUp, ItemName));
- qbsInventLookup.orderMode(OrderMode::GROUPBY);
- //qbsInventLookup.addSelectionField(fieldnum(SCI_InventSumLookUp, ItemName));
- qbsInventLookup.addSortField(fieldnum(InventTable, ItemName));
- //qbsInventLookup.addGroupByField(fieldnum(SalesLine,ItemId));
- }
3. ที่ Form
Method : executeQuery แก้
- element.inventDimSetupObject().modifyQuery(inventSum_DS,inventDim_DS,InventTable_DS);
4. ลาก Field จาก Data Sources InventTable ที่ต้องการแสดงเช่น ItemName ไปใส่ใน Form
https://community.dynamics.com/ax/b/hellodax/archive/2015/06/19/join-itemname-from-ecoresproducttranslation-and-search-name-from-inventtable-to-onhand-form-for-search-matter
No comments:
Post a Comment