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

COC - JumpRef on FormDataSource field - skip standard code

(0) ShareShare
ReportReport
Posted on by 1,650

Hello,

 I extended a standard form (PurchTable) via Extension in order to add a new field wich was also added to the table PurchTable via Extension.

Now I Need to customize the jumpRef, becaus would like to open a custom form / menu item if a certain condition is true.

I tried it with COC but the Standard Code is also executed and two new forms are opended.

7345.COC.jpg

What is the correct approach?

Thanks for any hint.

Sebastian

  • Verified answer
    nmaenpaa Profile Picture
    101,172 Moderator on at

    With event handler, you can cancel the super call in specific supported scenarios. One of them is the onLookup event. I'm not sure if it works with onJumpref event, but you can try it.

    community.dynamics.com/.../d365-ax7-form-design-control-level-event-handler-methods-onlookup

  • Verified answer
    Sukrut Parab Profile Picture
    71,741 Moderator on at

    There are some classes like FormControlCancelableSuperEventArgs    , FormDataFieldCancelableSuperEventArg which can be used in your scenario. For example ,

    to cancel super call of  click button , see how FormControlCancelableSuperEventArgs is used , similarly you can  use FormDataFieldCancelableSuperEventArg  to cancel super call.

    [FormControlEventHandler(formControlStr(LedgerJournalTable, Post), FormControlEventType::Clicked)]
        public static void Post_OnClicked(FormControl sender, FormControlEventArgs e)
        {
    		if (Box::yesNo("Are you sure you want to Post?", DialogButton::No, "Posting confirmation") == DialogButton::No)
            {
                FormControlCancelableSuperEventArgs     eventArg = e as FormControlCancelableSuperEventArgs;
    
                eventArg.CancelSuperCall();
            }
    	}
    

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 July Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 366

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 360 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans