Portal pages are often made from Entity Forms or Entity Lists. However, on an Entity Form, you can display lists using subgrids on regular forms in D365. If you think about adding a subgrid to a form, you can set the columns on the grid, but you can’t change the name displayed on each column, unless you change the display name on each field itself. That’s not practical, so we need a way to be able to change the display of each column just for the portal. That’s where Entity Form Metadata comes in. First, we have our form we’ve created by customising the solution.
Next, we add our Entity Form. Select the Entity you are working with (in this example it’s going to be Account). Once you’ve selected the Entity you can select the form from a filtered list of all the Account forms. Once the form is selected, you can either leave the next field blank, or select which tab should be displayed on the portal. It’s being made Read Only, and the Record Source Type is ‘Record Associated to Current Portal User. Once you select this option, set the Relationship from the portal user to the Account entity.
Now you can add the Entity Form to a new page in the portal. We can see the page displaying the form below, including the subgrid of any contacts working for the Account. If you want it to look a little nicer, the column widths and display name could be changed.
Go back to the Entity Form, and click on the Entity Form Metadata section, then click Add New Entity Form Metadata from the top of the grid.
We select the type of Subgrid, then pick which subgrid from the form we wish to modify. Finally, scroll down to the section to ‘Override Column Attributes’.
Add in each of the columns from the subgrid. We can then adjust the display name to use in the portal, and set the width for each one.
There is a grid column width style field to select from either pixels or percent which can be found by clicking on the Advanced settings from the top of the Grid Configuration area.
Now go and check out the subgrid on the page in your portal again. It might need refreshing a few times before you see the changes made, but be patient. You can always restart the portal if needed, but it shouldn’t need that level of rebooting. That’s it! Pretty simple and easy to change the subgrids to make them look cleaner and more relevant to your customers.
Want to just see how to do this? Check out the video below: