27.04.2012, 16:11 | #1 |
Участник
|
ax-erp: Code that must not be put in data source active() method
Источник: http://microsoft-dynamics-ax-erp.blo...t-in-data.html
============== Recently I got this error when trying to update spec quantity in salesEditLines form. Cannot edit a record in Sales order - Update table (SalesParmTable). The values displayed in the form are not current, so an update or deletion cannot be made. To view the current values, on the Command menu, click Restore or press CTRL+F5. Call stack shows nothing but suddenly system goes to the write() method of the SalesParmTable. It is strange that I didn't change any field but it fires SalesParmTable.write() data source method. Comparing the modification, I found that my fellow developer put a field assignment code within the SalesParmTable.active() method, so the code will always be run repeatedly (not sure how many time per minute, but it is very often). Since system get message that a field has been changed, write method is fired although the stack trace does not show any indication why write() method is fired. Again, it is hard since debugger doesn't tell what previous event causing this write() method. So then I remove the field assignment code from the datasource active() method and the problem is gone. The lesson from this is that we must never put an field assignment code within datasource active() method. It should only contains code for changing field behavior such as alowedit, enabled, visible, etc. Источник: http://microsoft-dynamics-ax-erp.blo...t-in-data.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
27.04.2012, 18:40 | #2 |
Участник
|
Что такое "field assignment code"?
|
|
27.04.2012, 18:44 | #3 |
Axapta
|
Код, устанавливающий значение полю. Где-то у него там в active поле в коде менялось, срабатывал write и все становилось плохо.
|
|
|
За это сообщение автора поблагодарили: S.Kuskov (1). |
|
Опции темы | Поиск в этой теме |
Опции просмотра | |
|