Announcements
No record found.
Hi,
According documentation the arguments in events within control addin must belong to an array.
I can't understand how should this work with arguments. Here's my code:
AL:
trigger PreviewDocument(DocId: Text)
begin
Message('Trigger PreviewDocument Invoked');
end;
AL Control Addin:
event PreviewDocument(DocId: Text);
Js script: (this is where the button is added inside a loop) In here, i tried without the brackets, with them and with and without question marks.
After inspect the page:
Nothing happens after the click.
Any ideas?
function previewDocumentFunction(DocId) { Microsoft.Dynamics.NAV.InvokeExtensibilityMethod('PreviewDocument', [DocId]); }
Update html <div id="buttonPreview"> <button onclick="previewDocumentFunction('" + DocId + "')">Preview</button> </div>
Hi, good day I hope this can help you, and give you some hints.
How to Start Developing with JavaScript Control Add-in
How to set focus on fields using Javascript in Business Central - D365 Business Central Freelance Developer
Best Regards Gerardo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
OussamaSabbouh 2,024 Super User 2026 Season 1
YUN ZHU 1,383 Super User 2026 Season 1