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
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
Hi @Naresh,
ReplyDeleteEvent Recorder only shows published Publishers. It will not show any subscribers.