Get started with Model-driven apps customization using code

You can customize model-driven apps by using tools that are available in Power Apps or that are described in the documentation. These customizations are supported and can be upgraded.

Customizations made using methods other than those described here are unsupported and could cause problems during updates and upgrades to model-driven apps. For more information, see Unsupported customizations later in this topic.

Topics covered in technical articles published on Microsoft sites such as this one are supported, but might not be upgradable.

Customizations using Power Apps

There are a variety of tools included with model-driven apps that you can use to customize them. Customizations made using the model-driven apps tools are fully supported and fully upgradeable.

The following customization methods can be used to produce fully supported customizations:

Note

The behavior of model-driven apps depend on customizations applied to the associated Microsoft Dataverse. More information: Supported customizations for Dataverse Fully supported means that developer support can provide assistance for customizations and that application support can help customers running those modifications.

Customizations applied using code

The documentation on this site for developers, technical articles, sample code published on this site, and information released by the Dataverse Developer Support Team are included in the area of customizations applied using code. The specific actions and levels of supportability and upgradeability are described later in this topic.

Client-side JavaScript

You can use JavaScript within model-driven apps in three areas:

  • Form Script event handlers: You can configure form event handlers to call functions defined in JavaScript web resources.

  • Command bar (ribbon) commands: You can use the <CustomRule> or <JavaScriptFunction> elements to define actions that call functions defined within JavaScript web resources.

  • Web resources and IFRAMEs: You can use JavaScript web resources within HTML web resources. IFRAMES configured to allow cross-site scripting, or scripts within HTML web resources included in a form may interact with the documented Xrm.Page or Xrm.Utility methods within the form via the parent reference.

All interaction with the application pages must only be performed through the methods documented in the Client API Reference for model-driven apps. Directly accessing the Document Object Model (DOM) of any Model-driven apps page is not supported. The use of jQuery in form scripts and commands is not recommended. More information: Client scripting in model-driven apps using JavaScript.

You can open model-driven apps forms, views, dialogs, and reports using the methods documented in Open forms, views, dialogs, and reports with a URL.

Ribbon customization

Use of RibbonDiffXml to add, remove, or hide ribbon elements is supported. Reuse of ribbon commands defined by Model-driven apps is supported; however, we reserve the right to change or deprecate the available commands. Reuse of JavaScript functions defined within ribbon commands is not supported.

Unsupported customizations

Modifications to Model-driven apps that are made without using either the methods described in this documentation or Power Apps tools are not supported and are not preserved during updates or upgrades of model-driven apps. Anything that is not documented in this documentation and supporting documents is not supported. Additionally, unsupported modifications could cause problems when you update through the addition of hot fixes or service packs or upgrade model-driven apps.

The following is a list of unsupported action types that are frequently asked about:

  • The reuse of any model-driven apps JavaScript code. This code may change or be overwritten during an upgrade.

  • Editing a solutions file to edit any solution components other than ribbons, forms, SiteMap, or saved queries is not supported. For more information, see When to edit the customizations file.

    • Defining new solution components by editing the solutions file is not supported.
    • Editing web resource files exported with a solution is not supported.
    • Except for the steps documented in Maintain managed solutions, editing the contents of a managed solution is not supported.
  • Displaying a form within an IFrame embedded in another form is not supported.

See also

Supported customizations for Dataverse
Apply business logic using client scripting in model-driven apps using JavaScript
Customize commands and the ribbon
Web resources in model-driven apps