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 :
Finance | Project Operations, Human Resources, ...
Answered

Avoid super call for data source lookup reference

(0) ShareShare
ReportReport
Posted on by 1,089

Hi Experts,

I have written a COC for form data source field employee. is there any way i can avoid calling super() using _formReferenceControl ? I tried by using FormDataFieldCancelableSuperEventArgs class but it didnt work.

public Common lookupReference(FormReferenceControl _formReferenceControl)
{
next lookupReference(_formReferenceControl);
return PurchReqLine::lookupRequester(_formReferenceControl);
}

Thanks in advance

I have the same question (0)
  • Verified answer
    WillWU Profile Picture
    22,361 on at

    Hi Guruprasanna,

    FormControlCancelableSuperEventArgs and FormDataFieldCancelableSuperEventArg can be used in Lookup event.

    For example,the following codes:

    [FormControlEventHandler(formControlStr(WorkOrderTable, WorkOrderLine_JobTypeCopy1), FormControlEventType::Lookup)]
    public static void WorkOrderLine_JobTypeCopy1_OnLookup(FormControl sender, FormControlEventArgs e)
    {
    
    FormRun  formRun  = sender.formRun();
    //canceling super()
    FormControlCancelableSuperEventArgs cancelableArgs = e as FormControlCancelableSuperEventArgs;
    cancelableArgs.CancelSuperCall();
    }

    CoC can't avoid the super() method in lookup/lookupReference.

    Try to use registerOverrideMethod.

    Refer to the codes:

    Dialog dialog = new Dialog("Select user");
    DialogField df = dialog.addField(extendedTypeStr(HcmWorkerRecId),"User");
    df.registerOverrideMethod(methodstr(FormReferenceControl, lookupReference),
    methodstr(YourClass, lookupWorker),
    this);

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 551 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans