How to create an Advanced Grid.

An advanced grid differs from a basic grid in a couple ways. A basic grid is based directly on a CRM View, with its columns, sorting and formatting, and shows all the records within the corresponding CRM view, without regard to any filtering that may be necessary for the portal user logged in. An advanced grid is created from a FetchXML statement that can be generated from an Advanced Find and copy/pasted into the Portal configuration. The FetchXML can then be easily edited to filter resulting records based on what you would like the portal user to see.

Creating an advanced grid starts out very similar to a basic grid:

Prerequisites:
  1. Portal Record
  2. Navigation Record (e.g. "All Cases")
  3. Page Record (e.g. "All Cases")

Steps:
Create a Widget of type: Grid
A. Map the Widget to a CRM entity (e.g. Case)

This is where we diverge from the basic grid's setup...

B. Instead of choosing a CRM entity, set "Use Custom Filter" to Yes.
C. Open a separate window to your CRM and open Advanced Find.
D. Customize the advanced find: Choose Case entity, start with the "All Cases" view to inherit its settings.
E. Add an extra filter to the Advanced Find that mimics who you want to filter the resulting Portal Grid for a particular Portal user. For example, if the portal user is a Contact record and you want to only show Cases where the customer (Contact) is the contact (portal user) you would have the following FetchXML. (notice that you have to choose a random contact in Advanced Find so you can edit that part of the FetchXML in a later step




F. And the corresponding FetchXML is:

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="incident">
<attribute name="prioritycode" />
<attribute name="ticketnumber" />
<attribute name="title" />
<attribute name="incidentid" />
<order attribute="title" descending="false" />
<link-entity name="contact" from="contactid" to="customerid" alias="ab">
<filter type="and">
<condition attribute="contactid" operator="eq" uiname="Eugene Brownell" uitype="contact" value="{CC663566-72E3-E411-8105-C4346BAD5274}" />
</filter>
</link-entity>
</entity>
</fetch>

G. Copy/paste the above FetchXML into the Widget record
H. Then edit the FetchXML, replacing the filter condition with a portal specific variable: "@portaluser.contactid"

<condition attribute="contactid" operator="eq" uiname="Joe Schmoe" uitype="contact" value="{CC663566-72E3-E411-8105-C4346BAD5274}" />
becomes:
<condition attribute="contactid" operator="eq" value="@portaluser.contactid" />

[screenshot]
  • Open the Page Record you created in the Prerequisites
    A. Add a Page-Widget to the Page
    B. Within the new Page-Widget, link to the Widget you just created above. Save-close the Page-Widget
    C. Back on the Page record, click "Update Layout XML" on the command bar.

    [screenshot]