To find the Primary- foreign key mapping in AX:

To find the mapping between primary and foreign key, use the following code……

static void Job3(Args _args)
TableId tableId1 = tableNum(VendTrans);
TableId tableId2 = tableNum(VendInvoiceJour);
DictRelation dictRelation;
DictField field, relatedField;
int i;
setPrefix(strFmt(“%1 -> %2″, tableId2Name(tableId1), tableId2Name(tableId2)));
dictRelation = new DictRelation(tableId1);
if (dictRelation.lines())
for (i = 1; i %2”,,;


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s