Показать сообщение отдельно
Старый 27.01.2014, 19:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
sashanazarov: Dynamics AX 2012: orig() method fails on derived tables
Источник: http://sashanazarov.blogspot.com/201...-fails-on.html
==============

Just found a bug in the table inheritance feature (kernel 6.0.1108.5781).

If you have a base table A with field B, and a derived table C with field D, then C.orig().B will return a strange value (or nil, depending on the field type).

In order to get the correct value, you will need to downcast C to A, and then call A.orig().B.

This is the job that reproes the issue:

static void reproOrigBug(Args _args)
{
CompanyInfo companyInfo;
DirPartyTable dirPartyTable;

select firstOnly companyInfo;

info(companyInfo.orig().DataArea);
info(companyInfo.orig().Name);

dirPartyTable = companyInfo as DirPartyTable;
info(dirPartyTable.orig().Name);
}
And this is the output:


I will report the issue to MS Support.


Источник: http://sashanazarov.blogspot.com/201...-fails-on.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.