Executed when a control add-in on the Microsoft Dynamics NAV Windows client page sends event information to the server-side business logic. You add C/AL code to process the data that is sent with the event.

OnControlAddin(Index ; Data)



Type: Integer

An integer identifier that a control add-in sends with the event.


Type: Text or BigText

A text string that a control add-in sends with an event.

The data type is determined by the binding target that is specified in the SourceExpr Property of the page field control. If the binding target is of type BigText, then the Data parameter is BigText. Otherwise, the Data parameter is Text

Applies To

  • Page field controls


An example of an event is when a user chooses a button in the control add-in user interface or when a user changes a value in a field. A control add-in can use events like these to invoke the OnControlAddin trigger and pass information as an integer in the Index parameter and as a text string in the Data parameter. To process the information, you add the C/AL code to the OnControlAddin trigger. For more information, see Exposing Events and Calling Respective C/AL Triggers from a Windows Client Control Add-in.


The following is an example of C/AL code on a OnControlAddin trigger that takes a text string that is received from a control add-in event and then displays the text string in a message window. Because the information is a text string, the Data parameter is used. To see how to develop and use a sample control add-in that implements this event, see Walkthrough: Creating and Using a Windows Client Control Add-in.

Copy Code

See Also