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 :
Microsoft Dynamics AX (Archived)

How to cancel method execution in pre-event handler

(0) ShareShare
ReportReport
Posted on by 737

Hi,

Can you please advise, is there any way to cancel execution of the calledMethod in PreEventHandler of this calledMethod (no any parameters are passed to the calledMethod).

Thank you

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    239,938 Most Valuable Professional on at

    If the application is a state in which it can't continue, throw an exception.

    If you want to execute your code instead of what's inside the method, the event handler isn't a good approach.

  • Community Member Profile Picture
    on at

    In case of Microsoft's new philosophy with extensions and the recommendation to use event handlers and delegates instead of overlaying - is there a "perfect" solution for this?

    As I mean in my case, I have to put a condition at the beginning of the method - if it is true, the method simply returns the default value otherwise it runs the AX standard logic. I'd like to put that in a pre event handler to avoid overlaying.

  • Martin Dráb Profile Picture
    239,938 Most Valuable Professional on at

    Your question seem to be about AX 7, while this thread is about AX 2012. Your goal also seem to be different than what was discussed in this (already answered) thread. Therefore you should create a new thread (with appropriate title and tags) and explain your problem in detail there.

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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Sanhthosh.Kumar.K Profile Picture

Sanhthosh.Kumar.K 2

#2
Raed Salah Bzour Profile Picture

Raed Salah Bzour 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans