Search code examples
scriptingcross-browserdynamics-crmmicrosoft-dynamicsdynamics-crm-2016

Open a CRM Entity from a Web Resource


I have a Web Resource that is working fine, except for one major headache.

I need to be able to click on a link and open an existing entity record. These two methods both almost get me there, but are blocked by different reasons:

1. Calling it directly with a link like this:

window.open('http://OurCRM/main.aspx?etc=10088&id=%7bc1d0db62-aa9e-e911-80e0-0a94ef08472f%7d&pagetype=entityrecord', '_self');

The problem with this one is that it doesn't work due to CRM saying

"Sys.InvalidOperationException: Sys.InvalidOperationException: Service Xrm.Interfaces.Services.IMostRecentlyViewedService already has an implementation"

note : If I take out the '_self' it works but then that defeats the purpose of what we're trying to do (need to keep it in the same tab).

2. using the Client API:

parent.Xrm.Utility.openEntityForm('ourentity', guid, '', '');

This one is blocked due to Cross Origin Frames being blocked by browsers.

Does anyone know how to do this?


Solution

  • To help others out, this was resolved in another, similar question

    accessing the logged in CRM user from custom page

    Basically we were looking at two different ways to handle the same problem of working with webforms inside CRM.