Perform predefined actions on the host model-driven form from within an embedded canvas app

Note

Effective November 2020:

  • Common Data Service has been renamed to Microsoft Dataverse. Learn more
  • Some terminology in Microsoft Dataverse has been updated. For example, entity is now table and field is now column. Learn more

This article will be updated soon to reflect the latest terminology.

Embedded canvas apps provide the ability to perform predefined actions on the host model-driven form. These actions enable makers to navigate, refresh and save the host model-driven form. Using these actions, an embedded canvas app can act as a more integral part of the model-driven form and the model-driven app.

The ModelDrivenFormIntegration object now includes the following new methods to enable makers to perform actions on the host model-driven form.

Navigates the host model-driven form to a main form and displays the specified row.

  • entityName - A required string parameter that specifies the parent table of the main form.
  • formName - A required string parameter that specifies the name of the main form to navigate to.
  • recordId - A required string parameter, that specifies the ID of the row to display in the main form.

Calling the NavigateToMainForm method can show the following error messages.

Error message Troubleshooting guidance
Table not found: [EntityName] Please check the value of the entityName parameter and ensure it is a valid table name and that the user has access to it.
Form not found: [FormName] Please check the value of the mainFormName parameter and ensure it is a valid main form name and that the user has access to it.
There was a problem loading the row. Please check the value of the recordId parameter and ensure it is a valid row ID and that the user has access to it.

Navigates the host model-driven form to a view.

  • entityName - A required string parameter that specifies the parent table of the view.
  • viewName - A required string parameter that specifies the name of the main form to navigate to.

Calling the NavigateToView method can show the following error messages.

Error message Troubleshooting guidance
Table not found: [EntityName] Please check the value of the entityName parameter and ensure it is a valid table name and that the user has access to it.
View not found: [ViewName] Please check the value of the viewName parameter and ensure it is a valid view name and that the user has access to it.

OpenQuickCreateForm(entityName)

Opens the default quick create form for an table.

  • entityName - A required string parameter that specifies the parent table of the quick create form.

Calling the OpenQuickCreateForm method can show the following error messages.

Error message Troubleshooting guidance
Table not found: [EntityName] Please check the value of the entityName parameter and ensure it is a valid table name and that the user has access to it.

RefreshForm(showPrompt)

Refreshes the data on the host model-driven form.

  • showPrompt - A required boolean parameter that indicates if a confirmation prompt should be displayed to the user before saving any unsaved data on the host model-driven form. Values should be "true" or "false".

Calling the RefreshForm method can show the following error messages.

Error message Troubleshooting guidance
Please use "true" or "false" as the parameter value. Please check the value of the showPrompt parameter and ensure that it is either "true" or "false".

SaveForm()

Saves the data on the host model-driven form.

Note

If you do not see the IntelliSense for the methods to perform predefined actions in embedded canvas apps that were created prior to the functionality being made available; save, close and re-open the app.

See also

Embed a canvas app on a model-driven form
Add an embedded canvas app on a model-driven form
Edit a canvas app embedded on a model-driven form
Customize the screen size and orientation of a canvas app embedded on a model-driven form
ModelDrivenFormIntegration control's properties and actions
Share an embedded canvas app
Guidelines on working with embedded canvas apps
Migrating embedded canvas apps on model-driven forms created using the public preview release to latest