Wednesday, November 18, 2009

CRM 4.0 URL issue while opening Word document

Today, I came across a peculiar Page Not Found issue.

I have been working on a piece of functionality that would grab the value selected by a user from a drop down box and generate a Word document based on the selected template. This generated Word document will then be saved to the file system and a prompt be made available for the user to Open, Save, or Cancel.

While I was developing and debugging the ASPX page that provided the selection of the template name, everything was working fine. The document was generated, saved, and the user prompt was appearing.

After I published my ASPX page to the CRM web site, I customised the ISV.config to add a button which will initiate my custom ASPX page.

The button would take the user to : http://mysite/industries/

Every time I pressed the button, the ASPX page loaded up fine until I selected a template and pressed the 'Generate' button. Internet Explorer gave me a 'Page not found' error.

Initially, I thought there was something stopping the code from running since it is now integrated with the CRM web site. But I suddenly had an idea to change the URL I had placed onto the CRM button.

Instead of having - http://mysite/industries/
I changed it to this - http://mysite/industries/default.aspx

And BAM !!!!!!!!!!! That was it ! Now, it works as it should in the first place and behaves the same way as when I was debugging it using Visual Studio.

No comments: