{"title":"InvokeExtensibilityMethod method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods/devenv-invokeextensibility-method/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods/devenv-invokeextensibility-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods/devenv-invokeextensibility-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Use InvokeExtensibilityMethod to raise AL control add-in events from JavaScript in Business Central and coordinate calls with completion callbacks.","date":"2026-10-22","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Method signature","slug":"method-signature","at":277,"chars":205},{"level":2,"title":"Method parameters","slug":"method-parameters","at":482,"chars":982},{"level":2,"title":"Behavior when the client is busy","slug":"behavior-when-the-client-is-busy","at":1464,"chars":719},{"level":2,"title":"Coordinate calls with callbacks","slug":"coordinate-calls-with-callbacks","at":2183,"chars":684},{"level":2,"title":"JavaScript example","slug":"javascript-example","at":2867,"chars":566},{"level":2,"title":"Related information","slug":"related-information","at":3433,"chars":204}],"text":"Raises an event declared in an AL controladdin object. The corresponding trigger in the page's usercontrol handles the event on the Business Central server.\nLearn more about declaring events and handling them on a page in Control add-in object<../devenv-control-addin-object>.\n## Method signature\n`void Microsoft.Dynamics.NAV.InvokeExtensibilityMethod(name, arguments, skipIfBusy, successCallback, errorCallback)`\nThe method returns no value. Communication with AL is asynchronous.\n## Method parameters\nParameter|Description\nname|Type: String<br /><br />The name of an event declared in the AL controladdin object. Implement the corresponding trigger in the page's usercontrol. Required.\narguments|Type: Array<br /><br />An array of arguments to pass to the event's AL trigger, including when the event takes only one argument. Optional. For an event with no parameters, omit this argument or pass `[]`.\nskipIfBusy|Type: Boolean<br /><br />Controls whether to skip the invocation when the client is busy. Optional. The default is false. See #behavior-when-the-client-is-busy.\nsuccessCallback|Type: function<br /><br />An optional function called when the client completes the invocation. It receives no arguments.<br /><br />Syntax: `function successCallback()`\nerrorCallback|Type: function<br /><br />An optional function called when the client skips the invocation or the invocation fails. It receives no arguments.<br /><br />Syntax: `function errorCallback()`\n## Behavior when the client is busy\nThe table describes the busy-state decision after the page is open and the client session is initialized. When skipIfBusy is true, the containing page must also be the topmost page. Calls that proceed can still wait for client readiness or fail for other reasons.\nskipIfBusy|Client is busy|Action\nfalse|No|The call proceeds when the client is ready.\nfalse|Yes|The call is queued until the client is no longer busy.\ntrue|No|The call proceeds if the containing page is topmost. Otherwise, it is skipped.\ntrue|Yes|The call is skipped.\nIf a call is skipped, the client calls errorCallback if you supplied it. A skipped call isn't automatically retried when the client is no longer busy.\n## Coordinate calls with callbacks\nUse the callbacks to sequence calls, such as sending the next data block after the previous invocation completes. This helps avoid issuing too many concurrent calls.\n> IMPORTANT\n> These callbacks report the outcome of the client invocation. They don't provide an AL return value or exception details. Don't use them alone to determine whether AL business logic succeeded.\nTo send result data from AL to JavaScript, use a separate control add-in procedure call. See ../devenv-control-addin-asynchronous-considerations.\nLearn more about limiting concurrent requests in Control add-in performance best practices<../devenv-control-addin-bestpractices>.\n## JavaScript example\nThis example sends a customer number to AL. It assumes that the controladdin object declares a CustomerSelected event with one Text parameter and that the page's usercontrol implements the corresponding trigger. Run the script in the control add-in.\n```javascript\nMicrosoft.Dynamics.NAV.InvokeExtensibilityMethod(\n    \"CustomerSelected\",\n    [\"10000\"],\n    false,\n    function () {\n        console.log(\"The client completed the invocation.\");\n    },\n    function () {\n        console.error(\"The invocation was skipped or failed.\");\n    });\n```\n## Related information\nAL method reference<../methods-auto/library>\ndevenv-getenvironment-method\ndevenv-getimageresource-method\ndevenv-openwindow-method\n../devenv-control-addin-asynchronous-considerations"}