How it works...

When you define your add-in control, you can use straight-up JavaScript as I did here, or you can use jQuery or Angular, depending on what your needs are and what the business requirements are.

When you define the control add-in in AL, you can set which scripts are part of the add-in. You have the option of using local scripts (like the ones in your AL project) or you can reference external scripts, including ones that are online, by providing a URL.

You can also define a special script in the control add-in in order to identify what script is executed, not only when the control add-in starts, but also if you need any specific scripts to fire when the add-in is refreshed or recreated.

Passing data to and from a control add-in is easily done by using JSON objects. Of course, you can also pass individual pieces of information using simple variable types. If you need to pass complex data structures, then using the built-in JSON types makes things quite easy!

Linking procedures and events that are contained within the add-in to ones in your AL code is done by simply making sure that they have the same name in the add-in and in the AL code. In this recipe, we created a ControlReady event and a SetTelevisionShow procedure in both the JavaScript add-in and in the AL add-in. Simply using the same names creates a link.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset