Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

How to use Events for Non-Hookable methods in D3fO

Posted on by 567

Hi,

How to use events for Non-Hookable methods in D3fO for extension process.

I am trying to use event but it's throwing error 

"Pre or post event handlers can only be created on hookable methods. Hookable methods are non-abstract methods that are either public or have been attributed with Hookable(true)."


Please help.

*This post is locked for comments

  • sumit k Profile Picture
    sumit k on at
    RE: How to use Events for Non-Hookable methods in D3fO

    Hi, You can either ask microsoft to make this method Hookable or write the logic in form initialized event handler. I see that the said method is private and is called only from the form init() method. So, if your logic works fine even after calling all the private methods, you can use the form event handlers.

  • Verified answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: How to use Events for Non-Hookable methods in D3fO

    We asked MS guys about this couple of times and they says that there is no way to completely avoid overlaying of App Suite now, in future they will do refactoring and add extension points, but now it's impossible to customize some places with extensions only.

    They recommend to reduce overlaying by adding delegates or making methods hookable.

  • Udit Profile Picture
    Udit 567 on at
    RE: How to use Events for Non-Hookable methods in D3fO

    Hi Ievgen,

    Thank you for your response.

    What should you recommend do I use overlaying or not? As per I know we shouldn't use overlaying because overlaying will affect in future up gradations.

  • Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: How to use Events for Non-Hookable methods in D3fO

    Hi Udit Kumar,

    Application Suite does not have enough extension points and often it's not possible to avoid overlaying when you deal with App Suite.

  • Udit Profile Picture
    Udit 567 on at
    RE: How to use Events for Non-Hookable methods in D3fO

    Hi Martin,

    As you mentioned, we can customize the method, that means overlaying and overlaying is not recommended.

  • Udit Profile Picture
    Udit 567 on at
    RE: How to use Events for Non-Hookable methods in D3fO

    Hi Martin,

    Thank you for your quick response.

    I want to add a small logic in createData2Controls method on EcoResProductCreate form. How can I achieve this?

    Thank you.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,030 Most Valuable Professional on at
    RE: How to use Events for Non-Hookable methods in D3fO

    You can only add event handlers to methods that are public or decorated with the Hookable attribute. Otherwise you can't do that.

    If you can customize the method, you can make it hookable.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,188 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,030 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans