Login to Dynamics 365 CE, open any of the Entity’s form and either pick any of the existing single line of a text field or sub-grid control or add one to the form.
We will use Single Line of Text if we want to pass the current record as context and Sub-Grid if we want to pass the list of related records as context.
In this post, we will first see how to pass the current record as context.
For this let us open Lead form and select Topic field which is a single line of text for customization (Change Properties).
Select Controls tab, and click on Add Control and choose Canvas app.
Here Entity name is auto-populated by the selected Entity and although it seems editable, changing it will have no effect.
App ID is auto-generated on creation of canvas app.
Let us click on Customize to create our canvas app. This opens the PowerApps Studio.
ModelDrivenFormIntegration is the special control which provides us the contextual data from our form.
Clicking on Edit for the Fields property for the gallery1 control opens a pane that shows all the fields from our lead entity.
Let us change the Layout to Title, subtitle, and body and set Body1 to the description, Subtitle1 to Fullname and Title2 to Subject.
Now before saving and publishing the app, go to File à App Settings à Advanced Settings
Set Enable app embedding user experience as On.
Save the App to the Cloud. This also publishes the app.
Back in our form editor, we can see the App ID auto-populated
Select Web option for the Canvas App in the Controls Tab.
Click on Ok to close the form, followed by Save and Publish.
We can see the Canvas App in the form in the Unified Client Interface
Although the app doesn’t make much sense, it gives an idea on how to configure things for embedding it within form. This feature really opens up infinite possibilities.
Get all the details here
Hope it helps..