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

Announcements

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 289 Most Valuable Professional

#3
Subra Profile Picture

Subra 244

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans