|
25.10.2007, 16:52 | #1 |
Участник
|
Filter By Field
Hi,
Fist I'm apologize for my English. I have a following situation: I must change ItemId lookup into InventJournalTransfer form, becouse I must display ExtCodeValue from ExtCodeValueTable (if any) for the items. I have created new form in AOT form node.In datasource node (on the form), I have added two tables: InventTable and ExtCodeValueTable. JoinSource on the ExtCodeValueTable is InventTable and JoinMode is OuterJoun becouse some items may has not external code.InventTable and ExtCodeValueTable has link - InventTable.RecId = ExtCodeValueTable.ExtCodeRelationRecId.The form have a grid control with some fields from standart lookup (InventTable), and one field from ExtCodeValueTable (ExtCodeValue which is external code). The problem is: I have to filter by ExtCodeValue.When I click "FilterBySelection" on contectMenu in field column, it's executed filter method on the fieldControl.In this method I do this: PHP код:
X++: public void removeFilter() { Query query = InventTable_Q; ; if(query.dataSourceTable(tableNum(ExtCodeValueTable)).joinMode() == JoinMode::InnerJoin) { query.dataSourceTable(tableNum(ExtCodeValueTable)).joinMode(JoinMode::OuterJoin); InventTable_ds.executeQuery(); } super(); } thank you in advance. |
|
25.10.2007, 17:01 | #2 |
Banned
|
.executeQuery() is called.
|
|
25.10.2007, 17:55 | #3 |
Участник
|
|
|
25.10.2007, 18:01 | #4 |
Banned
|
|
|
25.10.2007, 18:57 | #5 |
Участник
|
When it is filtering with "Filter By Field" strange why executeQuery did not invoke.
X++: public void executeQuery() { QueryBuildRange qbr; Query query = this.query(); ; qbr = this.query().dataSourceTable(tableNum(ExtCodeValueTable)).findRange(fieldNum(ExtCodeValueTable, ExtCodeValue)); if(qbr) { query.dataSourceTable(tableNum(ExtCodeValueTable)).joinMode(JoinMode::InnerJoin); } super(); } |
|
25.10.2007, 18:57 | #6 |
Участник
|
When it is filtering with "Filter By Field" strange why executeQuery did not invoke.
X++: public void executeQuery() { QueryBuildRange qbr; Query query = this.query(); ; qbr = this.query().dataSourceTable(tableNum(ExtCodeValueTable)).findRange(fieldNum(ExtCodeValueTable, ExtCodeValue)); if(qbr) { query.dataSourceTable(tableNum(ExtCodeValueTable)).joinMode(JoinMode::InnerJoin); } super(); } |
|
26.10.2007, 15:41 | #7 |
MCTS
|
1. Override filter() method on ExtCodeValue field (ExtCodeValueTable data source) like this:
X++: public void filter(str _filterStr, NoYes _clearPrev) { if(!_filterStr) _filterStr = InventTable::findRecId(ExtCodeValueTable.ExtCodeRelationRecId).ItemId; InventTable_ds.query().dataSourceTable(tableNum(ExtCodeValueTable)).joinMode(JoinMode::InnerJoin); InventTable_ds.executeQuery(); super(_filterStr, _clearPrev); } X++: public void removeFilter() { InventTable_ds.query().dataSourceTable(tableNum(ExtCodeValueTable)).joinMode(JoinMode::OuterJoin); InventTable_ds.executeQuery(); super(); }
__________________
В глухомани, в лесу Несмотря на красу Дни проводит Лиса Патрикевна. Я никак не пойму Отчего, почему Не пускают куму На деревню |
|
30.10.2007, 17:49 | #8 |
Участник
|
All is Ok.
Цитата:
Сообщение от Russland
1. Override filter() method on ExtCodeValue field (ExtCodeValueTable data source) like this:
X++: public void filter(str _filterStr, NoYes _clearPrev) { if(!_filterStr) _filterStr = InventTable::findRecId(ExtCodeValueTable.ExtCodeRelationRecId).ItemId; InventTable_ds.query().dataSourceTable(tableNum(ExtCodeValueTable)).joinMode(JoinMode::InnerJoin); InventTable_ds.executeQuery(); super(_filterStr, _clearPrev); } X++: public void removeFilter() { InventTable_ds.query().dataSourceTable(tableNum(ExtCodeValueTable)).joinMode(JoinMode::OuterJoin); InventTable_ds.executeQuery(); super(); } |
|