Hi all,
Imagine the following situation.
A javascript client add-in. From the add-in I need to ask NAV to send me some data.
I can add an event handler to my add-in. Let's call it 'OnGetCustomerName'.
c#:
public delegate void GetCustomerNameEventHandler(string customerNo);
[ApplicationVisible]
event GetCustomerNameEventHandler OnGetCustomerName;
JavaScript:
var customerNo = '1000'
Microsoft.Dynamics.NAV.InvokeExtensibilityMethod("OnGetCustomerName", [customerNo]);
This will raise the event in C/AL and I can start getting the customer by its number. But I cannot return any data to the client add-in this way.
How could I return the customer name to the javascript add-in?
Gr, Erik
0
Answers
You could watch this video (for NAV2013R2, but still valid) https://msdn.microsoft.com/en-us/dynamics/nav/dn848430.aspx
But if I need data right away inside a callback, there is no way to do it that way.
Of course the customer example was fictional and easy. The real task is more complex (a lazy loading request inside a treeview).