Skip to main content

MSDYN365BC - Event Recorder - How to Identify Event to subscribe for Extensions?

Hi Readers,


Thank you for all your question. In this article, we will discuss a question from Justin Arnold.
"How Do we identify Which Event to Subscribe to appropriately integrate our own logic?"

With Business Central Microsoft Released a Feature called Event Recorder which works in the same way as Permission Recorder in NAV?


In this article, we will see what Events are available when user try to Post the Sales Order and then identify which one to use to check mandatory fields before posting. Also, we will see what additionally we can do with Event Recorder.

Open Sales Order Window and create a new sales order which is ready to Post as shown below.



Now in a separate window, Open Business Central Client and using Tell Me feature to search for Event Recorder as shown below. Now when we are ready to click Start in Event Recorder Window and then Post Sales Order.



After posting of the Sales order, Stop the Event Recorder process.


Stopping the Event Recorder will specify how many Events were called during the action that you performed which is posting a Sales order. This window then will show all Events triggered during the process as shown below. Sort the window using field 1 call order. This will show events called during execution.



I think OnAferCheckMandatoryFields (Call Order 22), will be the event that will provide me the place where I can add my code. Let's check is that the right event after using one more cool feature with Event Recorder.

If you move toward Right of the Event Recorder Window, you will find a Field GETALSNIPPET, If you click on the event record Business Central will provide the snippet for the Event Subscriber which you can Copy and Paste in AL Window to subscribe.


Now we will see where this event is placed and what Microsoft is doing in the Procedure where this event is placed. Right Click on Object (Sales-Post) and select Go To Definition. This will open Codeunit 80 (Sales-Post.dal) where we can see all code.



As we can see Microsoft is calling all TestField to check all mandatory fields that are required before posting Sales order, so this is the right event that I want to subscribe for my custom TestField.

Event Recorder can be used for any process like validating a field and system will provide all available events during that process.

Hope you like the article and learn something new.

I hope Justin Arnold, I answered your question, if not please let me know.

Stay Connected and let me know your views as a comment to this article.

Regards,
Saurav Dhyani
www.sauravdhyani.com

Comments

  1. Hi @Naresh,
    Event Recorder only shows published Publishers. It will not show any subscribers.

    ReplyDelete

Post a Comment

Popular posts from this blog

VIEW SERVER STATE permission on SQL Server?

Hi all, Sometime While trying to Login into a database we face an error message as shown below. --------------------------- Microsoft Dynamics NAV Classic --------------------------- You cannot start Microsoft Dynamics NAV Classic because you do not have the VIEW SERVER STATE permission on SQL Server. Contact your system administrator. --------------------------- OK    ---------------------------

RTC Report It is not possible to instantiate the Visual Studio bridge.

Hi all, As a Navision developers I have Multiple Versions of Navision running in single Machine. As discussed Earlier in the post how to run multiple Version of RTC in single machine. So my machine have following details for RTC Versions - NAV 2009 R2    - is installed. NAV 2009 SP1  - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 SP1 IN\ NAV 2009         - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 IN\ This approach has been working great for execution of Classic and RTC Clients. However, after installing Dynamics NAV 2009 R2, if i tried to view the Layout for an NAV 2009 SP1 Report i was getting the following error: ---------------------------  Microsoft Dynamics NAV Classic  ---------------------------  It is not possible to instantiate  the Visual Studio bridge.  ---------------------------  OK    --------------------------- After searching for the error i figured out the issue was due to - Design change in NA

NAV 2013 R2 - Cumulative update 12 Released.

Hi all, Please find below the details of  Cumulative Update 12 released for Microsoft Dynamics NAV 2013 R2. Title - Cumulative Update 12 for Microsoft Dynamics NAV 2013 R2 Build No. - 38053 Release Date - October, 2014 Local Version Included - AU, AT, BE, CH, DE, DK, ES, FI, FR, IS, IT, NA, NL, NO, NZ, SE, UK, RU Download Link Note: Implementing this cumulative update will require a database conversion unless you have already implemented update rollup 5.