Ax2012 Many to one relationship between Two Table


I have create 2 new table: EmployerTypeTable and ListDocTable

An object of EmployerTypeTable can have many object of ListDocTable (one to many)

How can i create implement that in ax2012

thank you

It’s trivial. Each record of ListDocTable must contain a reference to the primary key of EmployerTypeTable (= so-called foreign key).

Thank you for replay,

what I have not explained well in my question is how can i create foreign key relationship between two table (one to many)

I 'm try to resolve this by create relation with EDT like this

  1. Table EmployerTypeTable

  2. EmployerTypeTable has two fields AccountId and Name

  3. Two indexes AccountIdx and NameIdx. Both have their AllowDuplicates property set as No and AlternateKey property set as Yes.

  4. EmployerTypeTable 's ReplacementKey property set as NameIdx.

  5. Second table ListDocTable will have two fields Name and AccountId.

  6. Create an Int64 type EDT EmployerTypeTableRefRecId with property ReferenceTable as EmployerTypeTable and Extends as RefRecId

  7. Drop this EDT on ListDocTable .

  8. Click Yes on the prompt

You described some steps, but you haven’t mentioned what problem you have with them.

thank you for replay,

if you can explain me step by step create a foreign key , because my solution does not work correctly

here print sreen of my issue

It seems to me that what you’re using is Int64Edit control, which is wrong. You need ReferenceGroupControl. It should be used automatically when you drag a foreign-key field to form design.