How to use RecId as a foreign key in the form

I have a table of elements, each of which refers to a different element in a different table. We say that objects are people, and related objects are favorite products.

Table A: Bob: 1, Sally: 1, Sue: 3

Table B: 1: Apples, 2: Bananas, 3: Oranges

People are tied to their favorite "products" using the RecId products listed in the People table.

I have a form / grid for editing people. Is there a way to get the FoodRecId StringView in the grid to convert its value so that the RecId numbers are not visible in the grid?

I already wrote multi-column queries to easily cope with creating the right relationships, but if RecIds in the grid could be hidden / replaced, the form would be much easier to use.

+3
source share
2 answers

Easy if you are using AX 2012: use surrogate keys . Using RecIdas foreign keys is now the Best Bird!

Update: The exact steps can be found in AX Musings .

If you are using an older version of AX, look at the use of ContactPersonRecIdthe form CustTable. It includes hiding the field RecIdin the form when using another editing field as a key ContactPersonName.

Although using it RecIdas a foreign key does not contradict best practice, it is usually avoided due to the difficulty of manually managing surrogate keys.

+2
source

Rave,

ReplacementKey - .

AX 2012 / . , AX 2009 / , SalesId, SalesTable, SalesLine. AX 2012. RecIds, , ReplaceKey ( !) RecId .

! http://amannain.blogspot.in/2012/04/table-relationships-learning-with.html

+1

All Articles