Curerntly I'am working on a scanner that inputs data into BC fields. The communication between the device and the software is in javascript.
I can send data from JS to BC with
Microsoft.Dynamics.NAV.InvokeExtensibilityMethod('BarcodeRead',[BCode] );
but I couldn't figure out how to send data back to JS.
(The reader has a screen, and I need to display warehouse inventory on it based on BC data).
My current best guess would be to send data with STREAMS to a .txt file, and the JS code read from that. But that would be slow and not so reliable in my opinion.
As you know allready that InvokeExtensibilityMethod can trigger events on the BC side, you know that you need a Control Add-In.
On the Microsoft Docs page about Control Add-Ins, there is an example which shows you how to call JS functions from BC:
In BC lingo, procedures are kind of the opposite of events.