Creating a key on existing tables (BC)

PottiPotti Posts: 3Member
edited 2019-06-12 in NAV Three Tier
Hi,

I want to know if creating a new key (primary / secondary) on existing tables (EG: Item) using AL is possible. If so, how can I code it down?

Answers

  • borealisborealis Posts: 33Member
    To the best of my knowledge this isn't permitted. I haven't read up on the latest cumulative updates so may be mistaken, but I know that as of CU4 this was not allowed.

    The only thing you can do key wise is add additional keys using added extension fields. Also worth noting that you cannot adjust the field groups. We have a client that has an extended item identifier (100 chars) and the shenanigans we had to go through to make that easily searchable/sortable without redoing everything involved were extensive.

    Our theory is that this is because the extension based fields/keys are stored in a separate table in SQL and the base tables are considered set in stone. Thus you cannot add a key that mixes, for instance, the product group code (original table, in master database table) and "custom subproduct group" (extension field, stored in the secondary extension table) as they're in completely different tables.
Sign In or Register to comment.