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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 30.03.2010, 18:26   #1  
ist is offline
ist
Участник
 
60 / 10 (1) +
Регистрация: 29.07.2007
exist method on temporary table
Hi,
I'm trying to make exist method on temporary table something like this...
Код:
static boolean exist(MyTempTable _tempTable,
                             RefTableId      _tableId,
                             RefRecId        _recId)
{
    return _tableid && _recId && (select RecId from _tempTable
                                                   where _tempTable.TableNum = _tableId
                                                       && _tempTable.RecordNo = _recId
             ).RecId != 0;
}
Just like find() methods on a temp table, I pass the temporary table reference as parameter, but compiler throw an error "The table _tempTable does not exist".

Any ideas what's the problem?
Старый 30.03.2010, 18:48   #2  
Wamr is offline
Wamr
----------------
Лучший по профессии 2014
Лучший по профессии AXAWARD 2013
 
1,737 / 858 (32) +++++++
Регистрация: 15.01.2002
Адрес: Москва
Записей в блоге: 7
X++:
static boolean exist(MyTempTable _tempTable,
                             RefTableId      _tableId,
                             RefRecId        _recId)
{
    if(! _tableid || !_recId)
        return false;

    select RecId from _tempTable
    where _tempTable.TableNum = _tableId
        && _tempTable.RecordNo = _recId

    return _tempTable.RecId != 0;
}
За это сообщение автора поблагодарили: ist (1).
Старый 30.03.2010, 19:08   #3  
ist is offline
ist
Участник
 
60 / 10 (1) +
Регистрация: 29.07.2007
tks.
Старый 31.03.2010, 10:16   #4  
oip is offline
oip
Axapta
Лучший по профессии 2014
 
2,564 / 1416 (53) ++++++++
Регистрация: 28.11.2005
Записей в блоге: 1
Just to make it clear for you. See the "Select statement" article in the Dev Guide:

Цитата:
Field select

It is also possible to use a select statement in a lookup on a field. After a select statement that fetched a record in a table, you can write .field name to reference a field in the table.

Notice the difference between the normal select and the field select. The field select operates directly on a table, whereas the select statement operates on a table variable.
__________________
С уважением,
Олег.
Теги
временная таблица

 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
PatrickChua: Temporary table Blog bot DAX Blogs 0 04.05.2009 14:05
method insert() when insert table from outside susenyudha DAX in English 1 29.08.2008 18:51
Axapta Lessons: Export a table to a file Blog bot DAX Blogs 0 28.10.2006 18:22
PatrickChua: Temporary table Blog bot DAX Blogs 0 28.10.2006 18:14
Говорят вышел SP2 для Axapta 3. Кто нибуть что знает на эту тему? soin DAX: Прочие вопросы 10 13.10.2003 10:43

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

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

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