PL 400 : manage dependencies between JavaScript libraries (Create a command button function)

JavaScript, along with HTML and CSS, is one of the major technologies of the World Wide Web. This script language defines the behavior of the hypertext mark language and helps in the beautification of the CSS web. JavaScript is a text-based language used both client-side and server-side which allows us to make web pages more interactive and dynamic.



A JavaScript is a library of pre-written JavaScript code that allows for easier development of JavaScript-based applications, especially for AJAX and other Web-centric technologies : Wikipedia

A JavaScript library is a collection of code or functions that developers can reuse and repurpose. Such a library contains various functions, methods, or objects to perform practical tasks on webpages or JS-based applications. Client scripting allows us to use JavaScript in Power Apps model-driven apps to implement custom business logic. Client scripting is run model-driven in response to form events.



Web resources in Dynamics 365 are virtual files stored in Dynamics 365 databases and are commonly used by developers and designers to extend web applications. In Dynamics 365(online), we use web resources to upload upload files to a Dynamics 365 database and then refer to them by name. JavaScript library can use as web resources and its events are related to forms and the control inside the form only. we can easily manage form scripts , webpage (HTML) web resources, or ribbon commands with help of JavaScript libraries.

Web resource dependencies:

After Script configuration of web resources, client scripts can be attached with ribbon commands and form events. Script web resources can be used to maintain libraries of client script functions that are written in either JavaScript or TypeScript and that can be accessed from within model-driven. Web resource dependencies do not provide any control over the order in which web resources are loaded. All web resources are loaded asynchronously and in parallel. If we have a JavaScript web resource that depends on another JavaScript web resource that has to be loaded and initialized before it can be initialized, we'll need to manage that dependency in another way.

Dependencies are installed only after the web resource is configured and published. Dependencies on unpublished web resources will not take effect until the web resource is published. The main purpose of these dependencies is to prevent a solution component from being removed when another solution component depends on it. This will save time as developers will not need to explicitly load many dependent web resources. With Dependency Configuration, we can just register the primary script and let the Dependency Configuration load other resources on which our code depends. 

 

Comments

Popular posts from this blog

Powering Up Your Analytics: Exploring Power Query in Power BI

Power App Component Overview : Canvas App vs Model-Driven App

Exam PL-400: Microsoft Power Platform Developer