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

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

I have the same question (0)
  • Verified answer
    nmaenpaa Profile Picture
    101,160 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,710 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

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 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans