Показать сообщение отдельно
Старый 21.03.2011, 09:59   #12  
jkspb is offline
jkspb
Участник
 
18 / 20 (1) +++
Регистрация: 03.03.2009
Аналогичная проблема возникает и при создании отчетов в ексель.

По утверждению EMEA Dynamics AX Support, одной из причин может быть фишка операционки - ghost window.
Они предлагают следующие варианты решения проблем:
Цитата:
Workaround 1:
Disable Window Ghosting as described in this post.

Workaround 2:
Debug the X++ code down to the line that is causing the error. Once identified, insert one line before this statement a call to the yield method of the xInfo class.

Example:
infolog.yield();
namespace = outlook.getNamespace(#mapidef);

Workaround 3:
Debug the X++ code down to the line that is causing the error. Once identified, place the statement inside a try / catch block. In the catch block simply retry the operation.

Example:
int retryCount = 3;
//...
try
{
namespace = outlook.getNamespace(#mapidef);
}
catch(Exception::Error)
{
retryCount--;

if(retryCount > 0)
retry;
else
throw(Exception::Error);
}
В моем случае, при массовой печати в ексель, помогает только добавление команды
X++:
infolog.yield();
перед каждой командой обращения к COM объекту.

Последний раз редактировалось jkspb; 21.03.2011 в 10:05.