10.07.2012, 00:11 | #1 |
Участник
|
emeadaxsupport: Surrogate foreign keys in AIF
Источник: http://blogs.msdn.com/b/axsupport/ar...ys-in-aif.aspx
============== Although the use of "natural keys" in place of surrogate foreign keys in AIF is a documented design change in AX 2012, it seems there are still some questions around this functionality. Per the documentation (http://msdn.microsoft.com/en-us/library/gg879708.aspx)... The document services framework "..replaces a surrogate foreign key (SFK) with the natural key for a specific table relationship." A simple example is the ContactForParty field in the DirContactPersonsService. This field in the ContactPerson table has an EDT of DirPartyRecId, but an error will occur if you attempt something like this... AxdEntity_ContactPerson contactPerson = new AxdEntity_ContactPerson(); contactPerson.ContactForParty = dirpartyrecId; This won't work with a recId value, because the service will determine that ContactForParty is a surrogate foreign key and will look for the natural (replacement) key on DirPartyTable. The replacement key on DirPartyTable is PartyNumberIdx, so what we need to pass in via the service is the PartyNumber. The concept seems pretty simple in this example, but it can become more complex when the replacement key is itself a surrogate foreign key. The WorkerSalesResponsible field in SalesTable is one such example.
Источник: http://blogs.msdn.com/b/axsupport/ar...ys-in-aif.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|