Compartir a través de


InvokeExtensibilityMethod Method

Invokes a C/AL trigger on the Microsoft Dynamics NAV Server on the page that contains the control add-in.

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 C/AL trigger to invoke on the Microsoft Dynamics NAV Server. This must be the name of the event specified in the .NET interface using the [ApplicationVisible] attribute that defines the control add-in.

arguments

Type: Array

An array that contains the arguments to pass to the C/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.

Example

For a detailed code example, see Walkthrough: Creating and Using a Client Control Add-in

var map = new VEMap('controlAddIn');
    map.onLoadMap = function () {
    var arguments = [map.GetCenter()];
    Microsoft.Dynamics.NAV.InvokeExtensibilityMethod('MapLoaded', arguments);
    };
    map.LoadMap(...);