Neil
Neil

Reputation: 2749

iFrame with CRM Entity Tab doesn't refresh

Using CRM 4, I have an entity form that contains a tab with an iFrame that contains an aspx page.

If the user clicks the save button on the entity form it calls the save call on the iFrame. This all works well. The problem I have is that the iFrame never refreshes.

I added code to the iFrame that refreshes the entity form when it is done working.

window.parent.location.reload()

When this is done and the entity form is reloaded the iFrame still hasn't updated.

I tried using javascript on the OnLoad event of the entity form to reload the iFrame page, this still doesn't refresh it. I used

crmForm.all.IFRAME.contentWindow.location.reload(true) 

and

crmForm.all.IFRAME.contentWindow.navigate(url)

but neither worked.

If I put the aspx page into a normal external iFrame it refreshes as expected when the page reloads so there must be something in CRM that is causing it to look at an old version of the page.

If I right click on the iFrame and click refresh then it reloads the page with the expected results.

Has anybody come across this before and know of a solution?

Thanks, Neil

Upvotes: 0

Views: 2762

Answers (1)

Neil
Neil

Reputation: 2749

Just add this to the head of the iFrame and it won't be cached

<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />

Upvotes: 1

Related Questions