In our recent upgrade from Dynamics NAV to D365BC we learnt a lot of things.
One was the events & subscriber.
Client required that they will have a single location for sales, which should not be selected by user and must be setup in such a way that when user creates sales order it should fill in from the default values.
So we build an extension where in system shall pick this from setup which was in inventory setup.
We extended the inventory table, and added a new field "Default Location", below extension.
Next we extend the inventory setup page to show the field.
We needed to add it at last, so we added it after Internal Movement Nos.
Now we needed to write a Codeunit as eventsubscriber,
This is the syntax for using the eventsubscriber,
[EventSubscriber(ObjectType::Codeunit, Codeunit::, 'OnSomeEvent', 'ElementName', SkipOnMissingLicense, SkipOnMissingPermission)]
Here OnSomeEvent is important, Press Ctrl+Spacebar to get the events present in the object what you have selected.
This way you can write you customized code that you have written on standard codeunits.
If you are unware of which event to check for code,
you can have a look onto the OnPrem development environment and check the code to see if there are events already present for use.
*This post is locked for comments