Home > CRM > How to add a custom page to CRM 4.0 like the Settings page

How to add a custom page to CRM 4.0 like the Settings page

I wanted to add a custom developed aspx page to the CRM site like the Settings page in order to have some functionality that cannot appear in an iframe on an entity form (that’s a business point of view).

The Target:
CRM Settings

The Result:
Custom CRM Page

So here are the steps to implement the same page in the above image (considering you have visual studio installed on the CRM server):

  1. Create new Class Library project
  2. Reference these DLLs: Microsoft.Crm.Application.Components.Application.dll, Microsoft.Crm.Application.Components.UI.dll, Microsoft.Crm.SafeHtml.dll you can find these DLLs in the bin directory of your CRM site (ex. C:\inetpub\wwwroot\bin)
  3. Add reference to System.Web
  4. Add a new class with the following code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.Crm.Application;
    using Microsoft.Crm;
    using System.Web.UI.WebControls;
    namespace iDemery.Crm.CustomPages
        [QueryStringParameter("pid", ParameterType.Integer), QueryStringParameter("vid", ParameterType.Integer)]
        public abstract class AdminTestPage : AppNavPage
            public AdminTestPage()
            protected override void ConfigurePage()
                base.HomePage = "adminTest.aspx";
                base.Area = "custom administration";
                base.Nav = "nav_administration";
            protected override void Render(System.Web.UI.HtmlTextWriter writer)
                Button button = new Button();
                button.Text = "helloooooooooooo";
  5. To enable debugging, right click on your project’s name in the solution explorer window and open the properties page, change the output path from the build menu to the bin directory of your CRM site (ex. inetpub\wwwroot\bin\)
  6. Create a new page and name it adminTest.aspx with the following line
    <%@ Page language="c#" Inherits="iDemery.Crm.CustomPages.AdminTestPage" %>

    Put this page in the CRM Site, Tools, Admin directory (ex. C:\inetpub\wwwroot\Tools\Admin)

  7. Now the page is ready and we want it to appear on the left CRM menu, go to Settings, Customization, Export Customization and choose to export the Site Map customization
  8. In the exported customizations.xml file add the following area:
          <Area Id="CustomPages" ShowGroups="true" Icon="/_imgs/settings_24x24.gif">
            	<Title LCID="1033" Title="Custom Pages" />
            	<Title LCID="1025" Title="Other language" />
            	<Description LCID="1033" Description=" Custom Pages" />
            	<Description LCID="1025" Description="Other language" />
    	<Group Id="TestSettings">
              		<Title LCID="1033" Title="Test Page" />
              		<Title LCID="1025" Title="Other language" />
    		<SubArea Id="nav_administration" Title="Test 1" DescriptionResourceId="Administration_SubArea_Description" Icon="/_imgs/ico_18_administration.gif" Url="/tools/Admin/adminTest.aspx" AvailableOffline="false" />
  9. Of course you can change the title, add titles from other languages, change the icon and save the customizations.xml file.
  10. Go to Settings, Customization, Import Customizations and import the customizations.xml file.
  11. Back to visual studio, build your project and you are done.
  12. To start debugging, go to Tools, Attach to process, and choose to attach to the w3wp.exe process
Categories: CRM Tags:
  1. Rajesh Lohana
    October 10, 2010 at 10:39 am

    I have followed all the steps as written on this site.

    But when i opened CRM website, i did not find any customized page.

    How can i troubleshoot this. What went wrong

    • Rajesh Lohana
      October 10, 2010 at 12:09 pm

      its working perfectly

  2. October 10, 2010 at 12:09 pm

    To get this page appear in the CRM left menu you got to edit the customizations.xml file and import it.
    To trouble shoot the problem start over from the 7th step, import the customizations.xml file and make sure that the area you added is in there.
    If its not there add it, save the file, and import it.

  3. October 10, 2010 at 12:13 pm

    Ok glad you got it working!

  1. No trackbacks yet.

Leave a Reply

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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: