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

Reference Group Lookup field displays nothing

(0) ShareShare
ReportReport
Posted on by
Greetings to everyone.
 
Right now I'm stuck or in a bind programming a reference group lookup field in a customized form for Dynamics 365 F&O.
 
I am creating a list page style form that will be displaying the summarized information for activities done by customers and assigned by employees. One of my columns is a reference group lookup field that has to display the name of the employee assigned to each activity, however, the field is showing in blank.
 
As a datasource to my customized form I added the smmActivities table, then, dragged and dropped the ResponsibleWorker field into a grid in my form. Furthermore, I checked into the properties of the field and set the Replacement Field Group  selecting Person, which corresponds to the field group of the same name in the HcmWorker table. Moreover, the field ResponsibleWorker is a data type Int64 field that acts as the foreign key in smmActivities table to relate to the HcmWorker table. 
 
//////
 
//////
 
//////
 
//////
 
In turn, I checked both the relationships, indexes, and properties in the HcmWorker table:
- For the replacement key property is set to HcmWorker_AK2.
- The index HcmWorker_AK2 is set as an alternate key allowing no duplicates. This key is composed of the fields: PersonnelNumber and Person.
- The Person field is a data type Int64 field that acts as the foreign key in HcmWorker table to relate to the DirPerson table.
- The Person field is assigned DirPartyRecId as its Extended Data Type property.
 
//////     //////
 
Following, I checked the properties of the EDT DirPartyRecId:
- Has DirPartyTable assigned as the Reference Table.
- The Node Table Reference has set the relation: DirPartyRecId == DirPartyTable.RecId
 
//////
 
Having checked everything is in order, then I debugged my form to test if the lookup field was working, but the field was displaying blank values and it wasn't.
 
Next, I tried overriding the lookupReference method on my form's datasource field where I want to perform the lookup on with the following code.
public Common lookupReference(FormReferenceControl _formReferenceControl)
{
                SysReferenceTableLookup sysReferenceTableLookup;
                Query query;
                QueryBuildDataSource queryBuildDataSource;
                QueryBuildRange queryBuildRange;

                sysReferenceTableLookup = SysReferenceTableLookup::newParameters(tableNum(HcmWorker), _formReferenceControl);
                sysReferenceTableLookup.addLookupMethod(tableMethodStr(HcmWorker,name)); 
 
                query = new Query();
 
                queryBuildDataSource = query.addDataSource(tableNum(HcmWorker));
                queryBuildRange = queryBuildDataSource.addRange(fieldNum(HcmWorker, RecId));

                queryBuildRange.value(queryValue(smmActivities.ResponsibleWorker));
                sysReferenceTableLookup.parmQuery(query);

                return sysReferenceTableLookup.performFormLookup();
}
 
Still, it is not working and the field still is displaying blank values.
 
//////
 
I have researched and googled every article on the subject then tried each method, but the field is not working.
 
Hence, I am requesting anyone to point me out whether I missed something or used a wrong approach in order to get the desired result.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,403 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans