connect 2022 banner tablet connect 2022 banner mobile

亿博电竞赛事博注网站

By Jake Oetinger | April 4, 2019

With every modification to Microsoft 亿博电竞 NAV we are faced with the tough question, where should I place this new code? Do we place it directly on the page? The action on the page? The table the page references? Or a code unit? This may seem like a minuscule decision but if your company repeatedly makes the wrong decision, you will accumulate a tremendous amount of technical debt. This causes upgrades and future modifications to substantially increase in time, difficulty and overall cost.

Avoiding altering base NAV functionality will make your upgrades faster and less painful. Microsoft has helped developers with this by introducing events in NAV 2016 . Events utilize a hooking pattern that allows developers to add their modifications without touching base NAV code.

In this example, we are going to set up an Event to run after we release a sales order.

Steps:

  1. Create a custom code unit to store your events.
  2. Create your function and set the property Event to Subscriber
    1. Publisher: Allows you to create a new Event. Objects comes with stock events, however, if you need to create custom events you would set your function to Publisher.
    2. Subscriber: Is called when Events are triggered.
      • For this example, after a sales order is successfully released, our code in this newly created Event Subscriber will run.

Setting a function to Subscribe to an Event

  • Set the Event to Subscriber
  • Set the EventPublisherObject to Codeunit 414, Release Sales Document
  • Set the EventFunction to OnAfterReleaseSalesDoc

Custom Code NAV

This message will appear, click Yes. This will change your event subscriber function parameters for you.

Custom Code NAV

You can now add custom code to your new Event Subscriber function.

Custom Code NAV

Here you can see our Event Subscriber running after you click release.

Custom Code NAV

Going back to our original question, where should we place custom modification code? We recommend placing customizations in custom code units utilizing events to avoid making modifications in base NAV code. This will minimize your company’s technical debt and allow for more cost-efficient upgrades and future modifications.

If you are a 亿博电竞 NAV user and have more questions, contact the team at 亿博电竞 for additional help.

Related Posts

Start the Conversation

It’s our mission to help clients win. We’d love to talk to you about the right business solutions to help you achieve your goals.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!

亿博电竞
csgo完美世界 加拿大28pc预测神测网 飞鱼电竞下注积分 加拿大28冷号APP计划 lol联赛 大圣电竞开盘