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

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 record.

  • entityName - A required string parameter that specifies the parent entity 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 record to display in the main form.

Calling the NavigateToMainForm method can show the following error messages.

Error message Troubleshooting guidance
Entity not found: [EntityName] Please check the value of the entityName parameter and ensure it is a valid entity 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 record. Please check the value of the recordId parameter and ensure it is a valid record 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 entity 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
Entity not found: [EntityName] Please check the value of the entityName parameter and ensure it is a valid entity 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 entity.

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

Calling the OpenQuickCreateForm method can show the following error messages.

Error message Troubleshooting guidance
Entity not found: [EntityName] Please check the value of the entityName parameter and ensure it is a valid entity 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