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, ...
Suggested Answer

Selection field returns wrong column label on lookup

(4) ShareShare
ReportReport
Posted on by 178
Hello,
I'm trying to create a lookup but I have a difficulty setting the right labels for them.
 
Like below the label for CustomerRef field is totaly not what it should be. How can I fix it? Tried to change to addSelectionFieldWithAlias but I'm getting and error 'Query selection aliases are not supported in the native stack'
 
 
 fsCtrlMultiSelect = formRun.design().control(fbsCtrlMultiSelect.id());
           Query query = new Query();

           if(tableId == CustInvoiceJour.Tableid)
            {
                QueryBuildDataSource qbds = query.addDataSource(tableNum(CustinvoiceJour));
                qbds.addSelectionField(fieldNum(CustinvoiceJour, InvoiceId));
                qbds.addSelectionField(fieldNum(CustinvoiceJour, InvoiceDate));
                qbds.addSelectionField(fieldNum(CustinvoiceJour, OrderAccount));
                qbds.addSelectionField(fieldNum(CustinvoiceJour, InvoicingName));
            }
            else if(tableId == CustPackingSlipJour.TableId)
            {
                QueryBuildDataSource qbds = query.addDataSource(tableNum(CustPackingSlipJour));
                qbds.addSelectionField(fieldNum(CustPackingSlipJour, PackingSlipId));
                qbds.addSelectionField(fieldNum(CustPackingSlipJour, OrderAccount));
                qbds.addSelectionField(fieldNum(CustPackingSlipJour, SalesId));
                qbds.addSelectionField(fieldNum(CustPackingSlipJour, CustomerRef))
                //bds.addSelectionFieldWithAlias("reference", fieldNum(CustPackingSlipJour, CustomerRef));
                qbds.addSelectionField(fieldNum(CustPackingSlipJour, InvoicingName));
            }
            else
            {
                return;
            }

            msCtrl = SysLookupMultiSelectCtrl::constructWithQuery(formRun, fsCtrlMultiSelect, query);
 
  • Suggested answer
    Jonas "Jones" Melgaard Profile Picture
    5,016 Most Valuable Professional on at
    The alias is not used when SysLookupMultiSelect* builds the grid, notice the call to addDataField.
     
    I haven't found, and am unaware of, any generic multi-select lookups where you can specify your own labels.

    You will either have to create your own custom lookup form or develop your own SysLookupMultiSelect classes that extend from SysLookupMultiSelectCtrl and SysLookupMultiSelectGrid and can accept custom labels.
  • Suggested answer
    Waed Ayyad Profile Picture
    9,218 Super User 2026 Season 2 on at
    Hi,
     
    Do you want to set a label for what? Can you show me screenshot of the lookup issue?
     
    Thanks,
    Waed Ayyad
  • RadekM Profile Picture
    178 on at
    This label 
    is certainly not this 
     
    And the problem is bigger while I'm using a different language in AX than English.
    It doesn't even have the correct translate for me since it should show me something like 'User reference number' so nothing compareable to what actually is in this field stored. 
    CustPackingSlipJour, CustomerRef

    Users hate it and want me to add THIS field since the labels are so different so even while they see the data in this field is what they want it is just wrong for them and want to add the field they want.
  • Suggested answer
    Waed Ayyad Profile Picture
    9,218 Super User 2026 Season 2 on at
    Hi,
     
    You can change the field label on the table level using extension, but you should know this will affect all screens that use the field in the system, another idea creates a display method that returns the field and use it instead of the field.
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • RadekM Profile Picture
    178 on at
    I can't use it as a display because they need this field to filter.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 430 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 368

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 364 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans