We can easily configure CRM entity form in Dynamics 365 Portal by creating an Entity Form. However, by using Entity Forms, we can only edit or create the fields on the Portal, we cannot add/edit records in the Sub Grid.
To add/edit both the fields and the Sub Grids that are present on the CRM forms, we need to perform some additional configuration, i.e., Sub Grid Metadata Configuration.
Steps to configure Sub Grid from Dynamics CRM forms in Dynamics 365 Portal:
Recently, we had a business requirement where we wanted to show Opportunity form that includes customer Contacts sub grid from the Opportunity entity and we wanted to create new customer records or update the existing records in the Sub Grid.
1. To achieve this, first we have to create the Entity form for the Opportunity entity record as seen in the screenshot below;
2. Then we need to add the Entity Form Metadata to allow the sub grid to create or edit the records as shown in the screenshot below;
3. While creating the entity form metadata, first we have to select the metadata Type (Attribute, Notes, Section, Subgrid, Tab or Timeline).
Here we are required to create the Sub Grid Metadata, so we need to select the View Actions as Create to add the option for creating records in Sub Grid or for updating the records in Sub Grid.
Then we have to select the Target Type as Entity Form, Webpage or URL as per our requirement. Then we need to select the Entity Form that we want to show when we click on the Create/Edit button of the Sub Grid.
We can also set the Button Label as shown in the screenshot below;
4. Once we follow the above steps, we can see the Sub Grid with the Create and Update options as shown in the screenshot below;
Hope this helps!