web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to display multiple columns in lookup from custom table in D365FO (SysTableLookup)

(6) ShareShare
ReportReport
Posted on by 322
Hi everyone,
 
Could you please help me understand this behavior?
 
I’m using a lookup that retrieves data from a custom table.
The table has multiple fields (e.g. code and name), and I’ve already added them to the table field group and SysTableLookup.
 
However, the lookup still displays only one column.
 
What is the correct way to display multiple columns in a lookup from a custom table in D365FO?
Is it required to use a lookup form instead of SysTableLookup?
 
Thanks in advance.
 
I have the same question (0)
  • Suggested answer
    Sagar121 Profile Picture
    1,160 Super User 2026 Season 1 on at
    Hi, can you please show us the code?
     
    You can add as many field as you want.
     
    sysTableLookup.addField(fieldNum(TableName, FieldName));
    Are you using event handlers make sure to cancel the super one. 
    e.cancel(true);
  • Statics 365 Profile Picture
    322 on at

    Hi @Sagar121, thanks for your reply.

     

    I’ve tried both approaches:

     

    1) Without custom code (using table relation / EDT lookup)

    I created a relation between my header table and the custom table, and also configured the EDT and field groups (Overview / AutoLookup).

    In this case, the lookup works, but it only shows one column (the key field) and does not display additional fields like the name.

     

    2) With custom code (SysTableLookup in form datasource)

    I also implemented a custom lookup using SysTableLookup in the form datasource fieldLookup() method, for example:

    SysTableLookup sysTableLookup =
    SysTableLookup::newParameters(tableNum(MyCustomTable), _formControl);

    sysTableLookup.addLookupField(
    fieldNum(MyCustomTable, Code), true);
    sysTableLookup.addLookupField(
    fieldNum(MyCustomTable, Name));
    sysTableLookup.performFormLookup();
     

    The lookup is triggered correctly, but the dropdown still behaves like a single-column lookup, and the additional field does not appear as expected.

    So my question is:


    • Is it required to use a lookup form (instead of a dropdown) to properly support multi-column lookup?

    • Or is there any additional setup required (EDT, field group, control properties, or event cancellation) to make a multi-column lookup work correctly for a custom table?

    Thanks in advance for your help.

  • Verified answer
    Layan Jwei Profile Picture
    8,165 Super User 2026 Season 1 on at
    Hi,
     
    Do you have title field1 and title field2 properties filled on the table?
    Fill title field2 property with name field and try again please
     
    No need to fill auto lookup property, by default it's filled with title field1 and title field2 + the first field in the unique index if it was different than the title fields (which is not ur case)
     
     
    So i assume Code is ur unique index and you will fill it in title field1, then add Name to title field2 . And there will no need for code in the first place
     
     

    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future.

  • Sagar121 Profile Picture
    1,160 Super User 2026 Season 1 on at
    Please feel free to make sure check out above points.  Are you using event handler ?
  • Statics 365 Profile Picture
    322 on at

    Hi everyone,

    I’ve tested this scenario and can confirm that the behavior is related to the Field Group configuration.

    In my case, the lookup was showing only one column when using SysTableLookup, even though multiple fields were added via addLookupField().

    The solution was to configure the table Field Group = AutoLookup properly.

    Once I added all required fields (e.g. Code, Name, Description) into the table’s AutoLookup field group, the lookup started displaying multiple columns as expected — without needing to switch to a lookup form.

    So in summary:

    • SysTableLookup does support multiple columns

    • The table must have the desired fields included in Field Group: AutoLookup

    • A lookup form is not required for this use case

    After updating the AutoLookup field group, everything worked correctly.

    Hope this helps.

  • Layan Jwei Profile Picture
    8,165 Super User 2026 Season 1 on at
    Hi Statics,
     
    You didn't mention description field at the beginning. So if you only wanted Code and Name then my solution which you already verified regarding title fields should work. Now since you want also description, then indeed you need to add the three fields to the autolookup field group and it should also work.
     
    Please also note SysTableLookup should work as well. Maybe show us full code to help (people most of the time do it on form control level)
    But no need to go with the code approach if simple changes on properties or field groups does the work.
     

    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 659

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 465 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 304 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans