How to modify CodeUnit

Hi All,

Please Anyone suggest me how to modify function in Existing Standard Codeunit 90 Purch. Post. in AL.

Thanks

What do you mean with how to modify a function? Do you know C/AL? Or do you want to do an extension?

If you want to do an extension, you can’t modify any standard objects, in codeunits you have to use hook-events to interact with standard C/AL code. Check if function you want to modify has any call to (publisher) event and see if what you want to do is possible within a call to that function.

Look for how to create an extension for dynamics NAV.

Sir Can you explain how to use hook-Events to inerect with standard codeunit in AL. Thanks for Reply.

Hi Akkrahul,

In docs.microsoft.com/…/subscribing-to-events you will find information about using published events in Dynamics NAV.

What do you need to change?

Changing codeunit 90 in C/AL, is generally something you should try to avoid, if you don’t know 110% what you’re dealing with. [emoticon:b5038b8386d240d3adfaf15c98300abc]

Subscribing to an event is much safer, but still a danger zone.

How to subscribe to events using AL:

https://docs.microsoft.com/da-dk/dynamics365/business-central/dev-itpro/developer/devenv-subscribing-to-events

The biggest challenge is that there are actually quite a lot event publishers in codeunit 90. So find the right one is often not that easy. It really depends what you need to change.