Dynamics Portals Styling – Design Forms with rich text and images
Its pretty common requirement in Portals to design the forms with rich text along with images.
One option to achieve this is by adding ‘Web Resources’ with HTML content to Dynamics forms. The downside of using ‘Web Resource’ is that it adds a white space towards the end.
In this article, lets see how we can achieve the styling by leveraging ‘Metadata’.
The Portal Metadata is flexible enough to hold the HTML content. All you need to do is, create a new Metadata for a Section and set the ‘Label’ field with HTML content.
Lets design a simple ‘Registration’ portal form with Logo and Content.
Steps to create a Portal Form:
For this scenario, I am using ‘Contact’ entity and created a new Form by name ‘Registration Form’.
- Open the CRM customization Form and open the ‘Section’, make sure below property is set.
- If this property is unchecked, HTML metadata content, which we are designing in next steps will not be shown on Portal form.
- Save and Publish the CRM form.
- Create a new ‘Entity Form’ and map the ‘Entity Name’ and ‘Form Name’.
- Create a new ‘Web Page’ and map the ‘Entity Form’
- Now, if you browse the ‘Entity Form’ in Portal, it comes as below.
Design the Form with Logo and Content:
Lets beautify this form by adding Logo and Rich text.
- To configure the Logo, first, create a new ‘WEB FILE’ record.
- Note down the ‘Partial Url’. You need to refer the exact value in your HTML.
- Under the ‘Notes’ section of the ‘WEB FILE’, create a new Note and upload the image as an attachment.
- Now lets design the HTML content.
- Open a HTML file using any of the text editor.
- Prepare HTML content as per your requirement
- Once the HTML design completed, open the Portal ‘Entity Form’ which we created in previous section and add a new ‘Entity Form Metadata’ record.
- Set Type as ‘Section’ and in the ‘Label’, paste the HTML content.
- Refresh you Portal screen and you should see the changes.
Note:
- HTML content added to ‘Metadata’ can be moved easily to other environments using Portal Record Movers
🙂
-
September 22, 2019 at 3:20 PMDynamics Portals – Add Download feature to the Forms | Rajeev Pentyala - Dynamics 365 Blog