Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Lookup on form datasou...
Finance forum

Lookup on form datasource field

(0) ShareShare
ReportReport
Posted on by 70

Lookup does not work on form data source field via chain of command. Though lookup works via event handler, I seek your input on achieving this by chain of command.

VERSION INFORMATION
Installed product version : Microsoft Dynamics 365 for Finance and Operations (10)
Installed platform version : Update26

[ExtensionOf(formDataFieldStr(InventNonConformanceTableCreate,InventNonConformanceTable,MyStingControl))]
final class FARInventNonConfTableCreateFrmCtrl_Extension
{
public void lookup(FormControl _control,str _filter)
{
next lookup(_control,_filter);

Query query = new Query();
query.addDataSource(tableNum(DirOrganization));

SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(DirOrganization),_control);

sysTableLookup.addLookupfield(fieldNum(DirOrganization,PartyNumber));
sysTableLookup.addLookupfield(fieldNum(DirOrganization,Name));

sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}

}

  • Suggested answer
    Waed Ayyad Profile Picture
    7,895 Super User 2025 Season 1 on at
    Lookup on form datasource field
    Hi,
     
    Check the below link, it shows you to add lookup vis extension:
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,624 Moderator on at
    Lookup on form datasource field
    You missed calling registeroverride method which can override the existing lookup from standard.
  • Suggested answer
    b_radlyjames Profile Picture
    3,087 on at
    Lookup on form datasource field
    I know this is an old post, however, I came across the need to override the lookup on a form datasource field.  I used the link shared on how to do via event handler which works good.
     
    As far as chain of command, I don't see how that would work.  You have to call the 'next lookup', but that would then cause the original lookup to occur which is not what we want.  I don't think chain of command is something that can be used in this situation.
  • Krushna Profile Picture
    70 on at
    RE: Lookup on form datasource field

    Hello,

    I followed below blog post and achieved it via event handler but I am struggling it through chain of command on lookup method of data source field.

    ievgensaxblog.wordpress.com/.../d365foe-how-to-override-form-data-source-field-lookup-method

    Thanks,

    Krushna

  • Krushna Profile Picture
    70 on at
    RE: Lookup on form datasource field

    Hello Blue Wang,

    NO.

    Yes, did it through event handler.

    Krushna.

  • Suggested answer
    Moeen Ahmed Sultan Profile Picture
    1,402 on at
    RE: Lookup on form datasource field

    Hi,

    You are using the form control's event handler. Try this code: msdynamics.nevoitech.com/.../how-to-create-lookup-in-form-data-source-field-in-d365fo

  • Blue Wang Profile Picture
    on at
    RE: Lookup on form datasource field

    Hi Krushna,

    Has your problem been solved?
    Still using event hander.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,233 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans