Refreshing custom parent page from CRM’s page

Hi,

I am working on a development of a custom aspx page for CRM 4, which is making use of grid view to show all the open activities.

That page would be the home page of CRM. The page is deployed within the isv folder as recommended by microsoft and it is being referenced within CRM through site map ! 

<SubArea Id=nav_home ResourceId=Homepage_Home  

Title=Activities Overview Icon=/_imgs/area/18_home.gif”   Url=http://localhost:5555/ISV/BHC/G.aspx   

Client=Web   Description=Activities Overview   PassParams=1 ></SubArea>

i.e. just above the SubArea with Id=”nav_activities”

The reason why i haven’t given a relative url is that if we are giving a relative url over there, CRM would append the organization name in the url ! ( This is implemented using Virtual path provider )

So what is the issue with that ?

Well the issue is,  if custom pages are making use of web.config of it’s own, becuase of the org name getting appened, CRM would start looking into the web.config of the CRM itself  (i.e. within CRMWeb\web.config) instead of your custom application’s web.config. Well this happens for pages referenced using sitemap only, this doesn’t happen in case of isv.config or iframe !

Coming back to the page, within the grid view we had to show links to open the activitiy and on editing the activity and clicking on save in that activity form, we wanted our custom page to get refreshed!

( One important thing to remember over here is that the pages must be in the same domain, otherwise we would recieve premission denied error while trying to use window.opener() )

So once grid is databound using sqldatasource, to show the link, we can add a template field over there   

// ///////////
 window.attachEvent(“onunload”, RefreshCustomPage);   

function RefreshCustomPage() {

//window.opener.document.forms[0].submit();

window.opener.location.reload();

// ///////////
 
Bye….
 

Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

2 thoughts on “Refreshing custom parent page from CRM’s page”

Share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s