Answered by:
Refresh Parent Page

Question
-
Hello Everyone,
I have created one custom page in vb.net, which has a link to CRM Account entity. The custom page contains data from the Account Entity.
I update the Account record opened through aspx page and save or save and close the record. Now I need that while saving the Account record the parent page whcih is a custom page should get refreshed with new data(updated). Just like CRM list view gets updated after saving a record.
I have written javascript for this, but this is not working.
window.opener.location.href = window.opener.location.href;
I have also tried following but no success.window.opener.location.reload(true);
Please suggest.
Thanking you in asvance.
Regards,
Bhavika PatelWednesday, August 26, 2009 12:38 PM
Answers
-
Hello Everyone,
hi,
I have created one custom page in vb.net, which has a link to CRM Account entity. The custom page contains data from the Account Entity.
I update the Account record opened through aspx page and save or save and close the record. Now I need that while saving the Account record the parent page whcih is a custom page should get refreshed with new data(updated). Just like CRM list view gets updated after saving a record.
I have written javascript for this, but this is not working.
window.opener.location.href = window.opener.location.href;
I have also tried following but no success.window.opener.location.reload(true);
Please suggest.
Thanking you in asvance.
Regards,
Bhavika Patel
but i have tried with your code and it works fine for me.
just added the following script in the child page and called the RefreshParent() function.
<script type="text/javascript" language="javascript">
function RefreshParent()
{
window.opener.location.reload(true);
window.close();
}
</script>
if this does not work....have your checked the security settings whether it allows javascript or not?
- Marked as answer by DavidJennawayMVP, Moderator Thursday, October 15, 2009 11:36 AM
Saturday, September 5, 2009 5:31 PM
All replies
-
Hi Bhavika,
If it is not working, is it giving you any error? Check the bottom left corner for any error notifications. I think you might be getting access denied errors but need to confirm.
Regards,
Chinmay
http://metrix.blogspot.comWednesday, September 2, 2009 8:33 AM -
If you Save the CRM Account form, the page will refresh losing any reference to the original window.
Unfortunately there is no "Find Window by Name" AFAIK that you can use.
An option is to close the original window before the Save and then reopen the window after the Save.Wednesday, September 2, 2009 4:43 PM -
The child window can be refreshed as many times as needed including saves. However, if the parent is somehow refreshed after the child window is opened then the child will lose reference to its parent. The only way around this is to create a top level window that opens the aspx page which opens the account form (e.g. top.html à custom.aspx à account) and then passing each window object to the top page for re-referencing.
GI CRM Blog * GI WebsiteWednesday, September 2, 2009 5:14 PM -
Try the following code.
In the caller ASPX page, define the following function:
document.refreshMe = function() { //perform custom code, then refresh the page here. window.reload(); }
In the OnSave event of child Account window:
//refresh the opener window. if (window.opener && window.opener.document.refreshMe) { window.opener.document.refreshMe(); }
HenriWednesday, September 2, 2009 11:41 PM -
- Proposed as answer by Brian_811 Thursday, September 3, 2009 1:25 AM
Thursday, September 3, 2009 1:24 AM -
Hello Everyone,
hi,
I have created one custom page in vb.net, which has a link to CRM Account entity. The custom page contains data from the Account Entity.
I update the Account record opened through aspx page and save or save and close the record. Now I need that while saving the Account record the parent page whcih is a custom page should get refreshed with new data(updated). Just like CRM list view gets updated after saving a record.
I have written javascript for this, but this is not working.
window.opener.location.href = window.opener.location.href;
I have also tried following but no success.window.opener.location.reload(true);
Please suggest.
Thanking you in asvance.
Regards,
Bhavika Patel
but i have tried with your code and it works fine for me.
just added the following script in the child page and called the RefreshParent() function.
<script type="text/javascript" language="javascript">
function RefreshParent()
{
window.opener.location.reload(true);
window.close();
}
</script>
if this does not work....have your checked the security settings whether it allows javascript or not?
- Marked as answer by DavidJennawayMVP, Moderator Thursday, October 15, 2009 11:36 AM
Saturday, September 5, 2009 5:31 PM