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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 24.04.2009, 17:51   #1  
Hugon is offline
Hugon
Участник
 
10 / 10 (1) +
Регистрация: 24.04.2009
Адрес: Leeds, UK
AX 4 EmplTable - Please help
Hi All
I have table axtable_1 with some information:

descrition | periodFromDate | periodToDate

and I have field EmplTable.field1 on each employee

empl01 | field1
empl02 | field2 ...

During running EmplTable I need system check axtable_1 and if system date belong to this period, system should put description to EmplTable.field1

Could you help me with this?

Thank you in advance
Hugon
Старый 25.04.2009, 00:04   #2  
ZVV is offline
ZVV
MCITP
MCP
Oracle
MCBMSS
 
1,006 / 246 (11) ++++++
Регистрация: 13.02.2004
Адрес: Минск
->
Цитата:
Сообщение от Hugon Посмотреть сообщение
Hi All
I have table axtable_1 with some information:

descrition | periodFromDate | periodToDate

and I have field EmplTable.field1 on each employee

empl01 | field1
empl02 | field2 ...

During running EmplTable I need system check axtable_1 and if system date belong to this period, system should put description to EmplTable.field1

Could you help me with this?

Thank you in advance
Hugon

If I've correctly understood your question you just need put some code in update() method of EmplTable.
Smth. like this:
X++:
if (<smth>)
{
   select firstOnly axtable_1
      where axtable_1.periodFromDate <= this.<smth>
           && axtable_1.periodToDate >= this.<smth>;

   if (axtable_1)
      this.field1 := axtable_1.description;
}
...
super();
Final version of code (with checks and so on) could you write yourself, I'm sure..
__________________
Zhirenkov Vitaly
Старый 25.04.2009, 00:40   #3  
Hugon is offline
Hugon
Участник
 
10 / 10 (1) +
Регистрация: 24.04.2009
Адрес: Leeds, UK
Thank you for your help.
This works when you save EmplTable. I need something when I am opening EmplTable, Probably I will need put some code on form not on table
Hugon
Старый 26.04.2009, 00:49   #4  
raz is offline
raz
NavAx
Аватар для raz
NavAx Club
Лучший по профессии 2014
Лучший по профессии 2009
 
1,490 / 1060 (38) ++++++++
Регистрация: 22.07.2003
Адрес: МО
You should use a display method on EmplTable and show this method in grid.

X++:
display field1_EDT myfield1(EmplTable _emplTable)
{
    field1_EDT   field1;
    ;
    if (<smth>)
    {
       select firstOnly axtable_1
          where axtable_1.periodFromDate <= _emplTable.<smth>
              && axtable_1.periodToDate >= _emplTable.<smth>;

       if (axtable_1)
          field1 = axtable_1.description;
    }
    else
    {
          field1 = smth;
    }

    return field1;
}
За это сообщение автора поблагодарили: Hugon (1).
Старый 27.04.2009, 12:40   #5  
Hugon is offline
Hugon
Участник
 
10 / 10 (1) +
Регистрация: 24.04.2009
Адрес: Leeds, UK
Thumbs up
Brilliant! This works now.
Thank you for your help.

Hugon
Теги
ax4.0

 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Dynamics AX: Managing Your Supply Chain Using Microsoft Dynamics AX 2009 - Book Review Blog bot DAX Blogs 0 31.03.2009 23:06
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
Arijit Basu: AX 2009 - Quick Overview Blog bot DAX Blogs 4 19.05.2008 14:47
Arijit Basu: Reporting & BI in AX: An Overview [Level 100] Blog bot DAX Blogs 0 07.01.2008 16:01
Inside Dynamics AX 4.0: Usage Scenarios Blog bot DAX Blogs 0 04.10.2007 05:15

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

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

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