Model Driven Apps (Part 3)
Neil Haddley • October 8, 2023
JavaScript to update a Business Process Flow Stage
I used JavaScript to extend a model driven app. I configured the app to call JavaScript functions on form events — OnLoad, OnChange, OnSave — and from button clicks. The functions validated input, showed and hid form sections, updated business process flow stages, and created new records.
See also: Power Apps Component Framework
I used Xrm.Page.data.process.moveNext() and Xrm.Page.data.process.movePrevious() to update a Business Process Flow stage from the browser console.
JavaScript to Show or Hide a Tab
I used Xrm.Page.data.ui.tabs.get("<tab name>").setVisible(false) and .setVisible(true) to hide or show a tab.
JavaScript to Read and Update Field/Control/Attribute Values
I used Xrm.Page.getAttribute('nh_businessneed').getValue() and .setValue('Hello') to read and update a field value.
JavaScript to clone a record
Configuring a model driven app to call a JavaScript function
I added a Clone button to a model driven app's form command bar and used JavaScript to implement the record copying functionality
Notice that in the Modern Command Designer the execution context is not passed to a JavaScript handler function as a parameter.













