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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Lookup method for form...
Finance forum

Lookup method for form control

(0) ShareShare
ReportReport
Posted on by 104

Hi All,

I have a question on the lookup for the form control.

In D365 FO, we have event handlers like onlookup for every control, I would like to write lookup method for the form control just like below.

public void lookup()

{

this.performTypeLookup(extendedTypeNum(AccoutNum))

}

Can someone help me how to write a method for the form control in D365 FO.

Best regards

Ramakrishna 

  • Verified answer
    KrishnamRaju Profile Picture
    95 on at

    Hi Rama Krishna,

    Below are the steps that you are supposed to do to have a onLookup event on any form control.

    1) Create a event handler class

    2) Right click on the form control's onLookUp event and paste it inside the event handler class and implement the logic as shown below. FYI - Below is the sample method that I have created to populate the lookup on Name field (Grid control) on CustGroup form. Also I have used CustAccount as the Extended data type. 

    [FormControlEventHandler(formControlStr(CustGroup, Grid_Name), FormControlEventType::Lookup)]

    public static void Grid_Name_OnLookup(FormControl sender, FormControlEventArgs e)

    {

    FormStringControl fsc = sender as FormStringControl;

    fsc.performTypeLookup(extendedTypeNum(CustAccount));

    FormControlCancelableSuperEventArgs ce = e as FormControlCancelableSuperEventArgs;

    ce.CancelSuperCall();

    }

    Thank you. Hope this helps.

    Regards,

    Krishnam Raju

  • rama.krishna.tanneeru@munich-airport.de Profile Picture
    104 on at

    Thank you Raju Sir :)

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