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

Community site session details

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

Custom lookup on reference group field

(0) ShareShare
ReportReport
Posted on by 432
Hi..

I have this out of the box lookup that has Purchase agreement field not filterable!



I tried to develop a custom lookup using different ways:
 
1- use a table method 




But The Purchase agreement field is empty.. it only shows values if I made the getPurchNumberSequence a display method.. but again I'm not able to apply filter!

2- add a custom query... it doesn't work and the column PurchNumberSequence doesn't appear at all

3- create a view that has the desired fields but it gives the error: AgreementLine isn't a form primary datasource

Categories:
I have the same question (0)
  • Martin Dráb Profile Picture
    236,477 Most Valuable Professional on at
    Custom lookup on reference group field
    Your attempt to use fields from different tables in addLookupField() is wrong. addLookupField() adds fields from the table that the SysReferenceTableLookup object was created for.
     
    For example, look at this code:
    lookup = SysReferenceTableLookup::newParameters(tableNum(AgreementLine), ...
    lookup.addLookupField(fieldNum(PurchAgreementHeader, PurchNumberSequence));
    You believe it adds PurchAgreementHeader.PurchNumberSequence, but in fact, it adds a field from AgreementLine that happen to have the same ID that PurchNumberSequence has in PurchAgreementHeader table. That's clearly wrong.
     
    Also, shouldn't you override FormReferenceControl.lookupReference() instead of lookup()?

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,964

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 564 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans