Skip to main content

Embedded canvas apps can now Navigate, Refresh and Save the host form

Headshot of article author Anees Ansari

Embedded canvas apps now provide the ability to perform actions to navigate, refresh and save the host form. With these capabilities makers can now achieve even richer integration between the embedded canvas app, the host form and other assets in the model-driven app, unlocking an entire new set of scenarios to help meet business needs.

Our embedded canvas apps feature has seen great uptake, thank you! However, the communication between the host form and the embedded canvas app was one-sided, with the host form providing data to the embedded canvas app. The embedded canvas app did not have a way communicate back with the host form or to link to other assets such as other forms and views. This made it harder for makers to enable seamless experiences in some scenarios.

With the new capabilities, an embedded canvas app can now communicate back to the host form in the form of predefined actions. Using these actions, the embedded canvas app can now act as a more integral part of the form and the model-driven app.

The capabilities enabled from within an embedded canvas app are:

  • Navigating the host form to another main form.
  • Navigating the host form to a view.
  • Opening a quick create form.
  • Refreshing the host form.
  • Saving the data on the host form.

These capabilities directly align with the top ask from our customers using the canvas app embedding feature.

Here is an embedded canvas app displaying a gallery of contacts. Makers can now enable a click on a contact in the gallery to navigate to the main form for the Contact entity and load the corresponding contact record.

NavigateToMainForm example

This is the expression being used.

NavigateToMainForm expression example

Extending the above example, a maker can add a button that when clicked shows the Quick create form for the Contact entity to create a new contact inline.

OpenQuickCreateForm example

This is the expression being used.

OpenQuickCreateForm expression example

Similarly, a maker can also add a button that navigates and shows the All Contacts view of the Contact entity.

NavigateToView example

This is the expression being used.

NavigateToView expression example

In addition to the functions outlined above, makers also have access to functions to refresh and save the host form.

The ModelDrivenFormIntegration object, that is available in embedded canvas apps, now includes the following new methods.

  • NavigateToMainForm(entityName, mainFormName, recordId)

Navigates the host 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.

  • NavigateToView(entityName, viewName)

Navigates the host 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.

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

  • RefreshForm(showPrompt)

Refreshes the data on the host 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 form. Values should be “true” or “false”.

  • SaveForm()

Saves the data on the host form.

For detailed guidance on the methods, please refer to the documentation here: Perform predefined actions on the host form from within an embedded canvas app .

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.

If you are already building embedded canvas apps, we hope that you find these capabilities useful in helping you build seamless, integrated embedded canvas apps to delight your end-users. If you haven’t yet tried creating embedded canvas apps, get started today!