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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 617

#2
André Arnaud de Calavon Profile Picture

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

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 298 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans