Perform actions on the host model-driven form from embedded canvas app using ModelDrivenFormIntegration control in Dynamics 365

Sending
User Review
0 (0 votes)

Let us continue our previous example of embedding the canvas app within the model-driven app and extend it to perform actions on the host form using ModelDrivenFormIntegration control.

This ModelDrivenFormIntegration control acts as a bridge and brings the contextual data from the host model-driven form to the embedded canvas app.

Here we will look at some of the pre-defined actions that can be performed using the ModelDrivenFormIntegration Control.

For this update our existing Canvas App and add the below buttons to the Form control in the canvas app

For the Save Form button, first, create the flow (Power Automate) which will update the record.

https://nishantrana.me/2019/11/04/step-by-step-calling-flow-from-powerapps-dynamics-365-ce-crm/

Below we are calling the Flow from Save Form button and passing GUID of the record along with values of name, city and phone field.

Here we have used ModelDrivenFormIntegration’s Item property to retrieve the id of the account record in our formula that is being used to call the Flow (Power Automate)

Result

updating the address 1 city field by appending text “Redmond” in the embedded canvas app.

save

  • Refresh Form

The true and false parameter value of the RefershForm method specifies whether to show prompt or not before saving any unsaved data on the host form.


Result

refreshing the form, shows the address 1 city field of the form in the right section with the appended text “Redmond” as saved earlier.

refresh

  • Navigate to Main Form

NavigateToMainForm method’s parameters are entity name, form name, record id.


Result

Here we are opening the same record.

navigatemain

  • Navigate to View

NavigateToView method’s parameters are entity name and view name.


Result

Opens the view specified in the parameter

NavigateToView

  • Open Quick Create Form

NavigateToView method’s parameter is entity name.


Result

Opens the quick create form of the entity specified in the parameter.

Get all the details here 

Hope it helps..