|
24.04.2009, 17:51 | #1 |
Участник
|
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 |
MCITP
|
Цитата:
Сообщение от 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();
__________________
Zhirenkov Vitaly |
|
25.04.2009, 00:40 | #3 |
Участник
|
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 |
NavAx
|
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 |
Участник
|
Brilliant! This works now.
Thank you for your help. Hugon |
|
Теги |
ax4.0 |
|
|