web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Aric Levin's Blog / Displaying Associated Views...

Displaying Associated Views from Other Entities

Aric Levin - MVP Profile Picture Aric Levin - MVP 30,190 Moderator

Sometimes, just as we would have a Navigation link that displays an IFRAME, we would like to display a View from another entity in there.

The Solution is pretty simple. We create the navigation links, provide the Url of the of the Related Entity View and finally use the loadIsvArea JavaScript function to display the results, as shown in the example below.

 

Sometimes, just as we would have a Navigation link that displays an IFRAME, we would like to display a View from another entity in there.

The Solution is pretty simple. We create the navigation links, provide the Url of the of the Related Entity View and finally use the loadIsvArea JavaScript function to display the results, as shown in the example below.

The following example displays the Activities and Closed Activities of a custom entity in of the Marketing List Form. The function receives as a parameter the ID of the record that I want to display and the entity type code (etc) of the related entity.

 

function SetInteractions(listid, etc) 
{
  var items = Xrm.Page.ui.navigation.items.get();
    for (var i in items)
    {
      var item = items[i];
      var label = item.getLabel();
      var id = item.getId();

      if (label == "Activities")
      {
         var urlActivities = encodeURI("areas.aspx?formid=56ac0775-3315-4971-9b61-9fa6548d8935&navItemName=Activities&oId=" + listid + "&oType=" + etc + "&pagemode=iframe&security=65591&tabSet=areaActivities");
         urlActivities = serverUrl + "/UserDefined/" + urlActivities;

         var navActivities = document.getElementById(id);
         navActivities.onclick = function () { loadIsvArea(Mscrm.CrmUri.create(urlActivities), false); }
        }

      if (label == "Closed Activities")
      {
         var urlHistory = "areas.aspx?formid=56ac0775-3315-4971-9b61-9fa6548d8935&navItemName=Closed%20Activities&oId=" + listid + "&oType=" + etc + "&pagemode=iframe&security=65591&tabSet=areaActivityHistory";
         urlHistory = serverUrl + "/UserDefined/" + urlHistory;  

         var navHistory = document.getElementById(id);
         navHistory.onclick = function () { loadIsvArea(Mscrm.CrmUri.create(urlHistory), false); }
      }
   }
}

Note: The code above applies to Microsoft Dynamic CRM 2011 and is not supported in future releases of CRM.

Comments

*This post is locked for comments