1
votes

This is for CRM 2016 On-Prem. We use IE 11 because of some crufty in-house "enterprise apps."

If a browsing session is opened by navigating to one of our applications first, and a user clicks on a link in that application that takes them to a CRM entity instance, we open that in a new tab (<a href="..." target="_blank">). When the user edits the entity and presses the Save & Close button, it closes the new tab and thus returns to our application. This is the desired behavior.

However, we also access our applications via nav bar items on various entities such as Opportunities (FYI, PassParams="1" is set for these nav bar items, but I have tested with and without that specified on the nav bar item for the below demo page and it makes no difference). So in that case, the sequence is:

  1. Open an entity instance in CRM, such as a specific Opportunity, perhaps from an Opportunity view or from a CRM dashboard.
  2. Click on the nav bar item, opening our custom application (either in a new tab or in an iframe on the same form - doesn't matter for this scenario).
  3. In our custom application, click on a link that opens a new tab to a different CRM entity instance to be edited, for example, a Contact.
  4. Edit the instance and hit Save & Close.
  5. Instead of closing, the tab returns to either a list view of the entity in question (Opportunities, in this case), or, if the original instance in #1 was opened from a CRM dashboard, then returns to that dashboard.

Setting rel="noreferrer" on the anchor in our application to open the second CRM entity instance makes no difference.

To rule out anything in our custom applications I created the following web page, put it in its own web app, and created a new nav bar item on the Opportunity to open it. We get the same behavior. If I open the web page below directly by navigating to it and click the link, it opens the CRM entity in a new tab, and Save & Close closes that tab and returns me to the page below. However, if I open this page via a nav bar item on an Opportunity and then click the link below, Save & Close keeps the new tab open and returns to the Opportunity list (because that's where I opened the Opportunity from).

<html>
<body>
<a href="http://crm/ourorg/main.aspx?etn=loan&extraqs=&id=deadbeef-dead-beef-dead-beefdeadbeef&pagetype=entityrecord" target="_blank">click me</a>
</body>
</html>

Hopefully the above all makes sense and this is something stupid I am missing in the SDK documentation.

1

1 Answers

0
votes

I would recommend you to keep the OOB “Save & Close” button for CRM behavior inside CRM platform. Create a new custom “Save & Close” button to achieve what you want from custom application. You can show/hide the OOB vs custom button using custom script display rule in Ribbon workbench.

Platform is using some form hierarchy/breadcrumb technique to differentiate the embedded form flow vs pop-out form (you can pop out any entity record using angle arrow next to close x icon on top right). That factor decides the layered form closure and landing in previous record form or list/Dashboard. I tried to decode longtime back without success.

You may be aware of this - Anything you want to do with the internal library/method/function is unsupported.