For Microsoft Dynamics CRM Online 2016 Update(8.0.1.360)
I created a new Dashboard and used a html web resource that contains a grid. There is a link that redirects to the detail page for each record. When I checked this in browser, It works properly. But from dashboard I cannot redirect to the Details page and following is the error that appears in console:
global.ashx?ver=-942172701:5 Uncaught Error: Sys.InvalidOperationException: Service Xrm.Interfaces.Services.IMostRecentlyViewedService already has an implementation
at Function.Error.create (global.ashx?ver=-942172701:5)
at Function.Error.invalidOperation (global.ashx?ver=-942172701:5)
at Xrm.XrmServiceDirectory.register (global.ashx?ver=-942172701:26786)
at Xrm.ScopedServiceDirectory.register (global.ashx?ver=-942172701:25708)
at Xrm.ScopedServiceDirectory.register (global.ashx?ver=-942172701:25708)
at Xrm.ScopedServiceDirectory.register (global.ashx?ver=-942172701:25708)
at Mscrm.RecentlyViewed.initialize (main.js?ver=-942172701:1)
at Mscrm.RecentlyViewed.endUpdate (global.ashx?ver=-942172701:5)
at Sys._Application.endCreateComponents (global.ashx?ver=-942172701:5)
at Sys._Application._raiseInit (global.ashx?ver=-942172701:5) .
Please help. Thanks in advance.
Following is the function to redirect:
function openEntityRecord(guid) {
var randomnumber = 100000000 + Math.floor(Math.random() * 900000000);
var url = CRMURL + "/main.aspx?etn=people&extraqs=&histKey=" + randomnumber + "&id={" + guid + "}&newWindow=true&pagetype=entityrecord";
alert(url);
window.location.href = url;
//window.open(url, "", "status=0,resizable=1,width=1000px,height=600px");
}
Xrm now provides us with a dedicated function for opening records, in your scenario it would be used like this:
See openEntityForm on MSDN