InvokeExtensibilityMethod Method

Invokes an AL trigger on the Dynamics 365 Business Central service on the page that contains the control add-in. For more information, see Control Addin Object.

Method signature

void Microsoft.Dynamics.NAV.InvokeExtensibilityMethod(name, arguments, skipIfBusy, callback)

Parameters

Parameter Description
name Type: String

A string that contains the name of the AL trigger to invoke. This must be the name of the specified event using the [ApplicationVisible] attribute that defines the control add-in.
arguments Type: Array

An array that contains the arguments to pass to the AL trigger. Note that the arguments must be supplied in an array even when the trigger only takes one argument.
skipIfBusy Type: Boolean

A value to indicate whether to invoke the extensibility method if the client is busy. This parameter is optional and the default value is false.
callback Type: function

A function that is called when the extensibility method has finished execution on the server. This parameter is optional.

Important

The callback function is useful for synchronizing multiple calls to the server. This is used, for example, when transferring multiple data blocks to the server to prevent overflowing the communication channel between the client and the server.

Callback Function Syntax

The syntax of the callback function is the following:

function callback()

skipIfBusy Options

The following table illustrates the different settings of skipIfBusy combined with the client’s status.

skipIfBusy set to Client is busy Action
false false Method call invoked.
false true Method call is queued and will be invoked once the client is no longer busy.
true false Method call invoked.
true true No method call.
var map = new VEMap('controlAddIn');  
    map.onLoadMap = function () {  
    var arguments = [map.GetCenter()];  
    Microsoft.Dynamics.NAV.InvokeExtensibilityMethod('MapLoaded', arguments);  
    };  
    map.LoadMap(...);  

See Also

AL Method Reference