Nice post – Developing plug-in for CRM 4


Hi,

While browsing found this wonderful articl, do check it

http://blogs.msdn.com/crm/archive/2008/03/07/developing-plug-ins-for-crm-4-0.aspx

Bye..

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….
 

CRM Error in custom page : Exception of type ‘System.Web.HttpUnhandledException’ was thrown.


I was getting the error while trying to run my custom aspx deployed within microsoft crm using sitemap !

If  I was giving the absolute path within the site map

<SubArea Id=nav_home ResourceId=Homepage_Home

Title=Activities Overview

Icon=/_imgs/area/18_home.gif

Url=http://localhost:5555/ISV/BHC/ActivitiesOverview.aspx

Client=Web

Description=Activities Overview

PassParams=1 ></

SubArea>

i.e.

Url=http://localhost:5555/ISV/BHC/ActivitiesOverview.aspx&#8221;

The page was working fine!

But on giving the relative path

Url =/ISV/BHC/ActivitiesOverview.aspx” i was getting the error.

One thing that changes is the url, when we give relative path it appends the organization name in the url. Url becomes something like this

http://localhost:5555/orgname/isv/bhc/activitiesoverview.aspx

But then there were few other pages that were working fine, and i was getting this error on only one page.

After spending some time on that, i realized that this particular line of code within the page was the reason for the error

connectionString =

ConfigurationManager.ConnectionStrings[“MSCRMConnectionString”].ConnectionString;

i.e. reading from the config file.

Now this information was within the web.config of the custom application deployed within CRM’s isv folder, but now with orgname appended it was trying to look for the same information in the web.config of the CRM itself ( crmweb/web.config )

It shows that “any custom pages added to the navigation using site map has to go through the virtual path provider” because of that it was not able to get the web.config of the custom application.

In case of custom pages used within isv.config and iframe, this doesn’t happen (i.e. it doesn’t pass throught virtual path provider so no orgname is appended to them )

Virtual path provider is the concept introduced in asp.net 2.0 and it is implemented in SharePoint as well, where we have certain pages called application pages within layouts folder of the 12 hive, they remain same for all the web application created in sharepoint i.e. same copy of the page is used for serving n number of web application created in SharePoint.

Bye ..

Error : The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.


Hi,

I got this error while developing an asp.net page with Sql server as database,

On checking the sql query i found out that the date value was not being sent in the format expected by the database , so by changing the format within my query resolved the issue !

Initially it was calendar.ToShortDateString() and i changed it to 

Calendar1.SelectedDate.ToString(“MM/dd/yyyy”)

Bye…

Error : This application is already precompiled in ASP.NET


Hi,

I was getting this error while trying to build one of the web site in Visual studio, on some searching found out the error was because of an existing PrecompiledApp.config within the application folder!

On deleting that file and rebuilding the web site, everything was back on track !

Bye..

Could not load type ‘Microsoft.Crm.Sdk.Crm2007.CrmServiceWsdl’.


Hi ,

Got the above error while referencing the CrmService.

Finally fould out that the following dll Microsoft.Crm.WebServices.dll wasn’t there in the crmweb\bin folder of the Crm server.

The error got resolved after i again placed the dll there !

Bye..

Nishant Rana's Weblog

Everything related to Microsoft .NET Technology

Skip to content ↓