Does subform link need to be part of primary key?

Calico
Calico Member Posts: 31
I have a card type form populated from Table1 with a subform populated from Table2. The Link field in Table2 is not part of the table's primary key and I am wondering if this is causing my problem. Scrolling through the records in the main form, the subform is populated correctly but as soon as I add another record in the subfrom, it displays all records from Table2 rather than filtering on the link field. The same happens if data entry on the subform fails a TESTFIELD or causes an ERROR. Should I make the link field part of the primary key?

I am asking this rather than trying it because it is going to cause a lot of rewriting of code. I have tried adding the link field to a secondary key and using that for the subform's Tableview but this makes no difference.

Comments

  • kine
    kine Member Posts: 12,562
    Yes, it must be primary key. Or you need to enable PopulateAllFields property on the subform to fill automatically all filtered fields, not just the PK fields... ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.