Extending UI with page trigger events
Page trigger events provide a way to extend the functionality of UI actions on pages. As with other event types, the main purpose of an event is to allow developers to add custom code to base application objects without intrusion into the code.
Objects subscribing to a page trigger event are invoked when the user runs an action in the page, after the C/AL code located directly in the page, is executed.
How to do it...
This recipe shows how to use a page trigger event to assign a user account to a sales order on the Release
action.
- Run the NAV development environment. In the Codeunit Designer, create a new codeunit 50903
Page Trigger Event
. - In C/AL Globals, declare a function
OnReleaseSalesOrderAssignUserID
. - Open the function properties. In the
Event
property, set the value toSubscriber
. In the current example,EventPublisherObject
is Page 42Sales Order
. You can either choose it from the lookup list or just typepage 42
in the property value. - Lookup the list...