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

Avoid super call for data source lookup reference

(0) ShareShare
ReportReport
Posted on by 1,093

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,363 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 692

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 532 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 478

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans