Options

Fields shown in drop-down / lookup

emerikspemeriksp Member Posts: 10
edited 2016-06-21 in NAV Three Tier
Hi,
If you open a sales invoice page (P43), on the lines (P47), you have the possibility to select e.g. Gen. Bus. Posting Groups via a field with lookup to the Gen. Business Posting Group table (T250). In the drop-Down field, the fields Code and Description are shown even though the primary key only consists of the field Code.

I want to do that too with a custom table.

I investigated the table 250 and saw that the DataCaptionFields was Code,Description, so naturally, I thought that this was the explanation. But after updating the DataCaptionFields in my custom table, I didn't get the result I sought.

Then I read about the Field Groups, and I managed to make it work, but reviewing the table 250, I discovered, that it doesn't have these Field Groups, and still it works.

So, why can't I show these fields of my own choice in the lookup by inserting them in the table's DataCaptionFields, when it works with table 250?


This is what I did:

Created a table with fields Code and Description.
Added both fields to the DataCaption field.

In another table, I have a field with TableRelation to this table.
I want this field to have a lookup to the first table, showing both fields, preferably without using Field Groups.


Can anyone help me?

BR Emerik

Answers

  • Options
    KishormKishorm Member Posts: 921
    The DataCaptionFields are not used for the lookup, only "DropDown" field group is. However there is also some built-in logic so that when "DropDown" field group is not shown it uses Code & Description (or No. & Name) fields by default if they exist. I don't know the exact logic but it's something like that. Make sure you create the Code & Description fields the same (same name & type) and it should work.
Sign In or Register to comment.