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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 05.11.2007, 00:32   #1  
offenmeier is offline
offenmeier
HAI; CAN HAS STDIO?
Аватар для offenmeier
Соотечественники
 
77 / 36 (2) +++
Регистрация: 17.02.2005
Адрес: Auckland, NZ
might be interesting
Hi, this is not a question, just want to share a little piece of experience.

Recently we had a problem in one of our implementations. Ax (4.0 SP2) would throw a stack trace in standard functionality (that shouldn't had been touched by any of our modifications) like "the function was called with wrong number of parameters". Reindexing/recompilation didn't solve the problem, while there were no compilation errors found. Also we couldn't trace into method where the stack trace was thrown, because debugger just wouldn't step in to the method.

The problem was rather silly though. In our modifications one of developers overridden a method in SalesFormLetter class and added a default parameter to the method:

X++:
method1(str _parm1, str _parm2, boolean _always = true)
..which is allowed and totally legal. But what he didn't do is that he didn't check if any of SalesFormLetter children already overridden this method. SalesFormLetter_PackingSlip had a method:

X++:
method1(str _parm1, str _parm2)
..which after our modifications turned to be totally illegal, because now children class had an overridden method with less parameters then parent class. This situation didn't produce compilation errors, but when calling SalesFormLetter_PackingSlip.method1() Ax would throw the stack trace.

The solution was to add a default parameter to SalesFormLetter_PackingSlip.method1() - and never use it:

X++:
method1(str _parm1, str _parm2, [I]boolean _always = true[/I])
__________________
our sharp bitter vitriol is not that of the vulgar.
Старый 06.11.2007, 11:37   #2  
Logger is offline
Logger
Участник
Лучший по профессии 2015
Лучший по профессии 2014
 
3,875 / 3123 (112) ++++++++++
Регистрация: 12.10.2004
Адрес: Москва
Записей в блоге: 2
Для Ax 3.0 SP3 в подобных случаях вообще клиент падал.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Dynamics AX: Interview with Microsoft Dynamics Executives Blog bot DAX Blogs 0 31.05.2008 00:10
casperkamal: Some interesting articles for Dynamics Ax developers Blog bot DAX Blogs 0 27.08.2007 16:10
dynamicsmatters: V3 - V4 Interesting bug Blog bot DAX Blogs 0 16.07.2007 02:58
casperkamal: XML Notepad - An Interesting utility for editing XML Blog bot DAX Blogs 0 30.06.2007 20:03
Dynamics AX Geek: Interesting fact about set(Types::Record) Blog bot DAX Blogs 0 28.10.2006 16:40

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

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

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