Are RecIds unique across Common tables in Dynamics AX 2012?

时间秒杀一切 提交于 2019-11-28 06:00:07

问题


Are the RecIds unique across Common tables in AX 2012? I read that this is version dependent, but I did not manage to find any information on this for AX 2012.

If not, doesn't that break polymorphic design of the tables in AX, where all AX tables extend from Common? And Common declares RecId...


回答1:


When Microsoft Dynamics AX inserts records into SQL tables, a unique RecId is assigned to each record regardless of the company each record is associated with. The field is 64 bit long and unique per table.

In Axapta 3.0 and below RecIds were unique per company account and 32 bit long. Thus a company could have no more than 4 billion records as the RecId could be negative.

Polymorphic design? I am not sure what you mean in this context, but given a RecId you do not know which table it belongs to, and you need that information in order to find the record:

public Common findRecord(TableId _tableId, RecId _recId) 
{
    Common record = new DictTable(_tableId).makeRecord();
    select record where record.RecId == _recId; 
    return record; 
}

In SQL no table is called Common. It is an AX concept, you may consider it an interface containing methods only.



来源:https://stackoverflow.com/questions/23899445/are-recids-unique-across-common-tables-in-dynamics-ax-2012

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!