Тема: Filter By Field
Показать сообщение отдельно
Старый 25.10.2007, 16:52   #1  
ist is offline
ist
Участник
 
60 / 10 (1) +
Регистрация: 29.07.2007
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 код:
public void filter(str _filterStr)
{
    
Query query InventTable_Q;
    ;
    if(
query.dataSourceTable(tableNum(ExtCodeValueTable)).joinMode() == JoinMode::OuterJoin)
    {
        
query.dataSourceTable(tableNum(ExtCodeValueTable)).joinMode(JoinMode::InnerJoin);
        
InventTable_ds.executeQuery();
    }
    
super(_filterStr);

the filter is removed from removeFilter method on the InventTable datasource that I have overrided.
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();
}
To this all is ok , but when i filtering with "Find by Field" from context menu on the ExtCodeValue column, I want to change also JoinMode to InnerJoin.The problem is that I dont know which method is invoked for this comand. The Dasource(InventTable) method findValue() is not invoked although that in the help write exact this.

thank you in advance.