AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX: За рубежом > DAX in English
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 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.
Старый 25.10.2007, 17:01   #2  
EVGL is offline
EVGL
Banned
Соотечественники
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
 
4,445 / 3001 (0) ++++++++++
Регистрация: 09.07.2002
Адрес: Parndorf, AT
.executeQuery() is called.
Старый 25.10.2007, 17:55   #3  
ist is offline
ist
Участник
 
60 / 10 (1) +
Регистрация: 29.07.2007
Цитата:
Сообщение от EVGL Посмотреть сообщение
.executeQuery() is called.
Ok but how I can distinctwish executeQuery() with and without filtering?
When "filter by field" is enabled i have to change JoinMode from OuterJoin to InnerJoin.
Старый 25.10.2007, 18:01   #4  
EVGL is offline
EVGL
Banned
Соотечественники
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
 
4,445 / 3001 (0) ++++++++++
Регистрация: 09.07.2002
Адрес: Parndorf, AT
Цитата:
Сообщение от ist Посмотреть сообщение
Ok but how I can distinctwish executeQuery() with and without filtering?
When "filter by field" is enabled i have to change JoinMode from OuterJoin to InnerJoin.
Maybe you cannot.
Try to look if a range exists on your field.
Старый 25.10.2007, 18:57   #5  
ist is offline
ist
Участник
 
60 / 10 (1) +
Регистрация: 29.07.2007
Цитата:
Сообщение от EVGL Посмотреть сообщение
Maybe you cannot.
Try to look if a range exists on your field.
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();
}
The debuger does not stop on the breakpoint
Старый 25.10.2007, 18:57   #6  
ist is offline
ist
Участник
 
60 / 10 (1) +
Регистрация: 29.07.2007
Цитата:
Сообщение от EVGL Посмотреть сообщение
Maybe you cannot.
Try to look if a range exists on your field.
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();
}
The debuger does not stop on the breakpoint
Старый 26.10.2007, 15:41   #7  
Russland is offline
Russland
MCTS
Аватар для Russland
MCBMSS
 
267 / 116 (4) +++++
Регистрация: 17.10.2005
Адрес: Донеччина, Україна
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);
}
2. Override removeFilter() method on InventTable data source:
X++:
public void removeFilter()
{
    InventTable_ds.query().dataSourceTable(tableNum(ExtCodeValueTable)).joinMode(JoinMode::OuterJoin);
    InventTable_ds.executeQuery();

    super();
}
Hope it will solve your problem
__________________

В глухомани, в лесу Несмотря на красу Дни проводит Лиса Патрикевна. Я никак не пойму Отчего, почему Не пускают куму На деревню
Старый 30.10.2007, 17:49   #8  
ist is offline
ist
Участник
 
60 / 10 (1) +
Регистрация: 29.07.2007
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);
}
2. Override removeFilter() method on InventTable data source:
X++:
public void removeFilter()
{
    InventTable_ds.query().dataSourceTable(tableNum(ExtCodeValueTable)).joinMode(JoinMode::OuterJoin);
    InventTable_ds.executeQuery();
 
    super();
}
Hope it will solve your problem
All is OK.Thank'a a LOT.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axaptapedia: Filter-by-Grid Blog bot DAX Blogs 2 30.05.2012 13:39
axStart: Check if the table field is mapped. Blog bot DAX Blogs 0 07.03.2009 00:05
palleagermark: Set focus on a particular field on an EP page Blog bot DAX Blogs 0 27.11.2008 14:05
axStart: table & field ID conflicts Blog bot DAX Blogs 0 29.05.2008 17:05
Kashperuk Ivan: Hotkeys and Find vs Filter in Dynamics AX 2009 Blog bot DAX Blogs 2 11.03.2008 12:06
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 11:18.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.