Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

How to create a custom lookup to show delivery addreses

(0) ShareShare
ReportReport
Posted on by 95
Hi
 
On a new forms grid, I need a lookup that can display delivery addresses related to a customer.
 
The tricky part is to show the address, but store the ref recid
 
the 'standard' way is to have a reference group on the form, but that doe not allow me to filter the records that is shown by customer or address type.
 
I have tried a SysTableLookup, but then only the recid is displayed on the form
 
Any hints ?
 
Thanks
 
Kind regards
Steen
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,587 Super User 2024 Season 1 on at
    How to create a custom lookup to show delivery addreses
    The simplest way would be to copy the standard code which is present in the SalesTable Form. If you navigate to SalesTable Form, in the datasource of SalesTable, under field DeliveryPostalAddress, you can see a method called lookupReference. That will help you.
  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    How to create a custom lookup to show delivery addreses
    Hi Steen,
     
    As Martin mentioned if you are using reference group control then you need to override the lookupReference method. Also, you need to use the SysReferenceTableLookup class for reference group control.
    Refer to the below blog for getting the customer delivery address from the list of tables.
     
    Thanks,
    Girish S.
  • Suggested answer
    Hana Xue Profile Picture
    Hana Xue Microsoft Employee on at
    How to create a custom lookup to show delivery addreses
    Hi,
    Found related articles for you on how to create a lookup in D365FO, you can simply check it out, hope it helps.
    How to create lookup in D365FO using X++ (d365snippets.com)
    Custom lookup in D365 X++ – Sampath's D365 F&O Technical Blog (wordpress.com)
    Best Regards,
    Hana
  • Martin Dráb Profile Picture
    Martin Dráb 230,817 Most Valuable Professional on at
    How to create a custom lookup to show delivery addreses
    I would use a reference group, override lookupReference() and implement the lookup with a custom filter there.

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

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans