Portals in Dynamics 365 | Entity Lists Part B

This blog is part of an evolving series on Portals in Dynamics 365, go here to view the Introductory blog with chapters.

In Entity Lists Part A, we covered the beginning of Entity Lists all the way to filter conditions. In this blog we will cover these three main areas:

  1. Search
  2. Custom JavaScript
  3. Grid Configuration

Search

Does anyone remember file cabinets anymore? I mean lots and lots of them containing tens of thousands of files. Oh sure, it wasn’t that bad to find a file that was indexed by last name and then first name, but it was still somewhat painful if you were attempting to find a file with the last name of “Smith” or “Johnson.” But what if you had to find all files where individuals lived in a certain city? Oh my! Get yourself a very large cup of coffee because we’re staying up all night.

Entity lists provide a great search feature that allows a Portal User to search on records – across columns of data. It can quickly narrow a list of 50,000 records to 1,000; it is very similar to the quick find of Dynamics 365 views.

Contact list before search is enabled:

portals

To enable the search for your Dynamics 365 Portal list, log into your Dynamics 365 and navigate to your desired Entity List and scroll down to the Search section.

Portals

Check Enabled, enter appropriate Placeholder Text and helpful Tooltip Text if needed.

portals

Contact list after search is enabled:

portals

Placeholder Text

Portals

Tooltip Text:

Portals

Default Tooltip Text (When you leave it blank on the Entity List record):

Portals

You can search by Name:

Portals

You can search by email address:

Portals

When searching, don’t forget to use the * (asterisk) as it helps with your results.

No results when searching by a partial Company Name:

Portals

Results when searching by Company Name with the asterisk:

Portals

You can search by phone number:

Portals

One item of particular importance is that we cannot search by parent fields. For example, in the image below, we received no results when searching on the Contact’s Account city.

You can quickly identify these columns, as the column headers are not links.

Portals

Custom JavaScript

As Portal developers, we have the ability to extend Entity Lists through JavaScript. In Portals in Dynamics 365 | CSS, we discovered how we can change the look and feel of the Entity List, but what are some things we can do with JavaScript?

You can add a conditional CSS rendering (Nishant Rana) based on certain values. Here is a basic template structure for manipulating Entity Lists.

With the help of an AJAX Web Template call (future blog named Portals in Dynamics 365 | AJAXing your Web Template), you can do quite a few things like display the number of related records (Activities) for each Contact or retrieve other Dynamics 365 data. Always consider the performance impact.

Today, we are going to point the Portal User to a Google Map from the combination of city and state/province values. To get started, fire up the Developer Tools for the Portal page that contains the Entity List. Right click the first city value (Seattle) and choose Inspect Element.

Portals

We need to grab the data-attribute of both the city and state.

Portals Portals

Back in Dynamics 365, navigate to the Entity List record and add the following JS code to the Custom JavaScript section. Change the data-attribute values accordingly.

The code is finding the city element (<td>), and from there finding the parent element (<tr>) so it can find all needed elements. It then grabs the city and state/province values and plugs them into a Google Map link.

Portals

Now the city column is a link:

Portals

That link points to a Google Map:

Portals

You could make this much more complex, but I wanted to show some possibilities for illustration purposes.

Grid Configuration

Grid Configuration is a set of tools that adds functionality to your Entity List.

View of Grid Configuration on the Entity List:

Portals

In many ways, it is a replication of the Dynamics 365 navigation for a record.

Portals

View Actions

Create

With Create, you can point to an Entity Form, Web Page, or a URL.

Create your Entity Form that associates to the desired entity type. Here is a Contact Entity Form pointing to Contact Entity and Contact – Short Form.

Portals

Back on the Entity List in the Grid Configuration, click ‘Create’ and the below information and Save.

Target Type = Entity Form

Entity Form = Newly created Entity Form

Button Label = Whatever you choose

Portals

Refresh the Portal page and view the new create button.

Portals

Because we pointed the Entity List to an Entity Form, a modal form appears when the New Contact button is clicked.

Portals

If we want to point the Portal User to a separate web page, we would need to create a Web Page that points to the Entity Form. Then we change the Entity List Grid Configuration Target Type to Web Page and select the correct Web Page.

If we want to point the Portal User to an URL on the Portal website, we can do that as well.

Download

With Download, you can allow the Portal User to download the Entity List results into an Excel spreadsheet.

Navigate to the Grid Configuration section on the Entity List form and click ‘+Download’.

Portals

A new Download section will appear. Enter a label.

Portals

Save.

Refresh the Dynamics 365 Portal Entity List page and view the new Download Results button.

Portals

File downloaded to local computer:

Portals

Download results:

Portals

Item Actions

I will not cover all options for Item Actions but wanted to cover a few so you get an idea of how they operate. As the name implies, it is an action taken against the selected record in Dynamics 365.

Details

When you want Portal Users to view detailed information on a record but prevent them from making any changes, you can use the Details Item Actions.

Create a new Details Item Action and fill in the necessary data:

Portals

In order for this to work correctly, the Entity Form Mode needs to be set to Read-Only and Record Source Type to Query String with “id” as the parameter name.

Portals

After refreshing the Entity List Portal page, you will see a drop-down option for each row.

Portals

Upon clicking the Details action, a portal read-only modal will appear.

Portals

Edit

Edit is very similar to Details but would normally be pointed to an Entity Form that is set to Edit.

Workflow

From the Portal Entity List web page, Portal Users have the ability to fire a Dynamics 365 workflow. This action could be used to send an email notification to a Dynamics 365 User or request that record to move to the next stage in some processing.

Override Column Attributes

The last topic to cover for Grid Configuration is the mechanism to override the default column names. Many times, the column names just don’t make sense to Portal Users for your organization. For example, a particular Entity List is only listing schools, so “Company” doesn’t cut it. We can change that.

Default Entity List column names:

Portals

Navigate to the Dynamics 365 Entity List record and scroll down to the Override Column Attributes section under the Grid Configuration section. Click ‘+Column’, find the desired Attribute, and provide a different column name. Click Save.

Portals

Entity List with changed column names:

Portals

We are now at the end of our 2nd section for Entity Lists within the Dynamics 365 Portal series. The last section for Entity Lists will cover the Metadata Filter, Map View, Calendar View, and OData Feed.

If you have any questions about Portals in Dynamics 365, please reach out to us.

Dynamics 365 CE (CRM) How-To eGuide

41 pages of step-by-step instructions for 6 different key tasks in Dynamics 365 Customer Engagement (CRM). Includes interactions with PowerApps and Flow!

Get the eGuide

Dynamics 365 CE (CRM) How-To eGuide

Get the eGuide