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, ...
Unanswered

Data entity lookup up of a field issue

(0) ShareShare
ReportReport
Posted on by 337
Hi,
 
I am trying to add lookup for a field CompanyLocation in my entity .It is a custom entity and I tried to get lookup for the field. When I try to get the locationId from LogisticsLocation, it is working , but I want the description also.
My questions:
1. Can I add 2 fields in lookup (Location Id and Description )? 
2. If not how can I add description in lookup . When i tried just description it shows nothing. But the same is working if I locationID. Am i missing anything?
 
Please see my lookup method added to the entity.
 
 [
     SysODataAction("NewVendInvoiceJournalLineEntityCompanyLocMappedCustomLookup", false),
     SysODataCollection("_fields", Types::String),
    SysODataFieldLookup(fieldStr(NewVendInvoiceJournalLineEntity, LocationIdCompany))
 ]
 public static str companyLocMappedCustomLookup(Array _fields)
 {
     // Field to return
     RefFieldName companyLocFld = fieldStr(NewVendInvoiceJournalLineEntity, LocationIdCompany);

     // Map fields for Office Add-in
     Map fieldMap = OfficeAppCustomLookupHelper::getFieldMap(
     tableStr(NewVendInvoiceJournalLineEntity),
     _fields
 );

     OfficeAppCustomLookupListResult result = new OfficeAppCustomLookupListResult();
     result.determinationFields().value(1, companyLocFld);

     LogisticsLocation logisticsLoc;
     int counter = 1;

     // Build lookup items
     while select Description,locationId from  logisticsLoc order by locationId
     {
       //  result.items().value(counter, logisticsLoc.Description);
         result.items().value(counter, logisticsLoc.LocationId);
         counter++;
     }

     return result.serialize();

 }
 
 
Please help.
 
Thanks,
Priya
Categories:
I have the same question (0)

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 659 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 289 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans