| Hammad Hussain
Client-Side Scripting in Dynamics 365
In this blog, we'll focus on how to add client-side scripting to a Model Driven Application. Read on to learn how to utilize a client-side script in Model-driven or Dynamics 365 Forms, as well as what methods and techniques are available. I'll try to cover as much information as possible to gain a thorough understanding of the implementation of client-side script on model-driven apps and Dynamics 365.
What is Client-side scripting on Model Driven App?
Client-Side scripts runs on model driven apps with reaction to form level events, for example – form on load event, form on save event, field on change event, command bar button click event.
- Get values or set values of fields in a form
- Show or hide UI components such as sections, tabs and fields
- Switching different forms on Model Driven application, if have multiple forms
- Open another form, reports, dialog box and to call custom web resource.
- Make interactions with Business process flows including stages and fields inside of stages.
Client Script logic runs as event handler for the form events. Here we should register event on form to execute the logic and a few events can be executed from code.
The most effective method to register Client script on Model driven form with assistance of Event Handlers. In the Form designer you can put different event handlers for events such as:
Form: It lets you create an event on form’s OnLoad and OnSave property for event handling.
Fields: It lets you create an event on Field’s OnChange property, such as hiding another field based on this field or setting a value for another field when some change is made to this field.
Tabs: It lets you create an event on Tab’s “On Tab State Change” property for event handling.
Client-side scripting plays a necessary role in Dynamics 365 especially when customizations are required that can not be accomplished by an OOB functionality. It can be used for a variety of functionalities such as validations on forms, adding custom buttons to the command bar, customizing UI, customizing business process flows and much more.
Join us next time, as we continue our journey of learning canvas apps.Click here to learn more about Imperium's Power Apps Services. We hope this information was useful, and we look forward to sharing more insights into the Power Platform world.