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 :
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();
}

}

I have the same question (0)
  • Blue Wang Profile Picture
    on at

    Hi Krushna,

    Has your problem been solved?
    Still using event hander.

  • Suggested answer
    Moeen Ahmed Sultan Profile Picture
    1,402 on at

    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

  • Krushna Profile Picture
    70 on at

    Hello Blue Wang,

    NO.

    Yes, did it through event handler.

    Krushna.

  • Krushna Profile Picture
    70 on at

    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

  • Suggested answer
    b_radlyjames Profile Picture
    3,155 on at
    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.
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    You missed calling registeroverride method which can override the existing lookup from standard.
  • Suggested answer
    Waed Ayyad Profile Picture
    9,039 Super User 2025 Season 2 on at
    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
     

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 > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans