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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

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

(1) ShareShare
ReportReport
Posted on by 143
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
    862 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
    143 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.

  • Layan Jwei Profile Picture
    8,114 Super User 2025 Season 2 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)
     
     
     

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 551 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans