Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Difference between Coc...
Finance forum

Difference between Coc and Event Handler in D365

(1) ShareShare
ReportReport
Posted on by 155

Hello Everyone,

Can anyone help me to understand the difference between Coc & Post Event Handler in 365.

  • Verified answer
    Jie G Profile Picture
    on at
    RE: Difference between Coc and Event Handler in D365

    Hi Mayur,

    COC is nearly the same as pre and post handlers, pre being before the next call and post after it. The advantage of chain of command is you can share the same method variables in the pre and post (before/after next() call) or share the same tts block inside your COC method. COC also supports return value and parameter modification of the extended method in a much more readable manner.

    For more details, community.dynamics.com/.../ax7-d365-chain-of-command-with-example

  • Verified answer
    Mea_ Profile Picture
    60,278 on at
    RE: Difference between Coc and Event Handler in D365

    Post Event Handler is static, does not allow you to have access to protected members of a class. Also you cannot add new method or class state via event handler, so CoC is way more powerful.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,997 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,831 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans