How to Display Document Templates Using a Custom Subgrid in CRM:

How to Display Document Templates Using a Custom Subgrid in CRM:

Table of Contents

By default, all document templates from an entity are displayed in the form ribbon, as shown in the screenshot From CRM.

How to Display Document Templates Using a Custom Subgrid in CRM:

However, if someone wants to display this list of documents directly on the form, there is no out-of-the-box feature to show only the documents related to a specific entity and allow downloads on click.

To achieve this, we will use a custom HTML web resource to display the document list on the CRM form and enable downloads on click. let’s Explore Complete Article on Display Document Templates with a Custom Subgrid in CRM.

How to Display Document Templates Using a Custom Subgrid in CRM:

Step by Step Guide:

Step 1:

First, create an HTML web resource and write code to display a simple table.

Step by Step Guide To Write HTML COde

Step 2:

Write a JavaScript function that triggers on the form onLoad event to retrieve document templates, filter them based on your criteria, and store them in an array.

Step 3:

Then, write a function to display all the templates stored in the array in a table. Each row should contain an anchor tag that allows users to download the template when clicked.

Step 4:

Then, write a function to download the template by passing the template ID and template name.

Then, write a function to download the template by passing the template ID and template name.

Step 5:

After completing this, create an HTML web resource in the solution in Power Apps.

After completing this, create an HTML web resource in the solution in Power Apps.

Then paste your code here and save and publish web resource.

After completing this, create an HTML web resource in the solution in Power Apps.

Step 6:

Then navigate to Power Apps and add an empty section to the form.

Then navigate to Power Apps and add an empty section to the form.

Step 7:

Next, open the Display dropdown, navigate to the HTML Web Resource section, and select your registered HTML web resource.

Next, open the Display dropdown, navigate to the HTML Web Resource section, and select your registered HTML web resource.

Step 8:

After that save and publish form.

Display Document Templates with a Custom Subgrid in CRM

Conclusion

By following these steps, you can successfully Display Document Templates with a Custom Subgrid in CRM. This approach enhances user experience by allowing direct access to relevant document templates within the form, streamlining workflows and improving efficiency. Implementing an HTML web resource ensures a customized, user-friendly interface for document management.

Readmore: access teams manage record security in dynamics 365

FAQ’s

Can I filter document templates based on user roles?

Yes, you can modify the JavaScript function to filter templates based on user roles by retrieving the user’s security roles and applying conditions accordingly.

Will this solution work on both model-driven and canvas apps?

This approach is specifically designed for model-driven apps. For canvas apps, a different method using Power Automate or embedded controls may be required.

How can I ensure the document list updates dynamically?

You can refresh the HTML web resource using JavaScript whenever a relevant action occurs, such as form save or a field change event.

Picture of SkySoft Connections

SkySoft Connections

SkySoft Connections is a software solution company that was established in 2016. Our quality services begin with experience and end with dedication. Our directors have more than 15 years of IT experience to handle various projects successfully. Our dedicated teams are available to help our clients streamline their business processes, enhance their customer support, automate their day-to-day tasks, and provide software solutions tailored to their specific needs. We are experts in Dynamics 365 and Power Platform services, whether you need Dynamics 365 implementation, customization, integration, data migration, training, or ongoing support.

Conatct us