Thursday, March 25, 2010

Localizing your custom solution and Silverlight

While localizing my custom website hosting a Silverlight 3 control, I added multiple resource files (.resx) to my xap and when I hit the page I got this error:
System.Windows.Markup.XamlParseException occurred Message="AG_E_PARSER_UNKNOWN_TYPE
On hitting this link I realized the goof up. One of the resx files had the constructor still declared as ‘internal’, and you get this error when the application is getting initialized and trying to access and internal resource. So I made the changes to set it to public, and it worked like a charm!!

CTP3 for MS CRM 5.0 now available!!

CTP3 for MS CRM 5.0 now available!!
The main features offered by CRM 5.0 include:
1. Features for end users

  • Enhanced Navigation - A “Fluent UI” like Office 2007
  • Single Page Forms - Single scrolling page, “quick access” navigation shortcuts and less pop-ups and clicks to complete common task
  • Data Filtering –In-line filtering like Excel, visualization of numeric data using in-line charts and availability of drill through charts
  • WSS integration -Document management, site and document library provisioning and check-in check-out capabilities.
  • Team ownership for entities

2. Features for Administrators and Customizers

  • Filtered Lookups :)
  • Solution Management -A single unit solution (a defined set of entity customizations, workflows, e-mail templates, security roles, plug-ins etc.), version controlled solution and ability to specify selected attributes for exporting
  • “Global Picklists” at solution level that are re-usable across multiple entities.
  • Drag and Drop form editor
  • New server role for running custom code
  • Plug-In Transaction support
  • .Net 4.0 Support out of the box
  • LINQ for CRM

Read more about CRM 5 at
and CTP3 for CRM 5 at

Monday, March 15, 2010

This is for beginners in MS CRM 4.0 wanting to understand the Security Architecture in MS CRM 4.0. Download the whitepaper from:

A brief summary for the Role Based Security and the Object based security is explained from the article:

To determine the extent to which users have access to the system and the resources it stores, Microsoft Dynamics CRM leverages two complementary security mechanisms:

  1. Role-based security in Microsoft Dynamics CRM focuses on grouping a set of privileges together that describe the tasks that are performed for a user in a specific job function. The basic concepts of role-based security include the following:
    o Users are assigned one or more roles based on their job function or tasks
    o Roles are associated with permissions (privileges and access levels) for the different business objects (entities)
    o Users gain access to entities or groups of entities in the system via membership in a role that has been assigned the necessary privileges and access levels to perform the users’ jobs.
  2. Object-based security in Microsoft Dynamics CRM focuses on how users gain access to individual instances of business objects (entities).

Role-based Security
Role-based security in Microsoft Dynamics CRM is based on the interaction of privileges and access levels, which work together through the use of security roles.

Privileges define what actions a user can perform on each entity in Microsoft Dynamics CRM. Privileges are pre-defined in Microsoft Dynamics CRM and cannot be changed; examples of privileges include Create, Read, Write, and Delete.

Access levels indicate which records associated with each entity the user can perform actions upon.The access level associated with a privilege determines (for a given entity type) the levels within the organizational hierarchy (User, team and Business Unit) at which a user belonging to a specific role can act on that type of entity.

Each security role provides a combination of privileges and access levels specific to a Microsoft Dynamics CRM job function.

Object-based Security

Object-based security applies to individual instances of entities and is provided by using access rights. An access right is granted to a user for a particular entity instance.
The relationship between an access right and a privilege is that access rights apply only after privileges have taken effect. For example, if users do not have the privilege to read accounts, they will be unable to read any account, regardless of the access rights another user might grant them to a specific account through sharing.

The article also provides greate examples for different combinations of privileges, access levels and access rights. Happy reading!!

Thursday, March 11, 2010

Visual Studio 2010 RC Installation Issue on Windows XP machine

While trying to install VS 2010 RC on my windows XP sp3 machine, I was facing this issue that the installer wasn't able to install any of the components after it installed .Net Framework 4.0. Once I installed .NET Framework 4.0, it prompted me to restart the machine, and on restart nothing really happened (though the setup was expected to resume). I re-clicked the setup and still nothing happened.

So after trying to re-install VS 2010 a couple times, I found out the solution to the problem -
Display the language bar at the taskbar, right-click on it and choose settings. Then remove the hand writing support from the list. There is a bug in the RC for computers with touch screens.

MS CRM 4.0 Worflow Issue

Recently I came across a scenario where it was required that workflow be triggered on change of a read only only field.

While testing I found that the workflow wasn't getting fired. I added the code to ForceSubmit the field OnSave of record.
Even after that the workflow didnt execute on change of that field.

Ultimately, I had to enable that field so that the workflow could trigger on field change. Additional logic (simply a workaround) had to be applied in order to achieve the desired functionality.

JavaScript code to pre populate fields on associated record opened from parent or related record

Recently, I came across a scenario, where it was required that some fields be pre-populated on a new form opened from associated view of a record.
One possible solution is to fire a SOAP Xml retrieve request to get the desired fields of the related record and set them on the new form. But this approach requires a database interaction using MS CRM web services, that can cause a noticeable delay in form load.
An alternative to this approach is to access parent record using JavaScript object model and access the fields on form to set values on new form.
Following sample code can be added to OnLoad event of form to achieve the same:

//Functionality- In create mode, get default values from associated location record
if (crmForm.FormType == 1) {

//If form is being opened using an existing parent record
if ((window.opener != null) && (window.opener.parent != null) && (window.opener.parent.document != null) && (window.opener.parent.document.crmForm != null)) {
var oParentCrmForm = window.opener.parent.document.crmForm;
if (oParentCrmForm == null oParentCrmForm == undefined) {
else {
if (oParentCrmForm.ObjectTypeName == 'parent') {
//Set field value as on parent
crmForm.all.field1.DataValue = oParentCrmForm.all.field1.DataValue;

Data fetched using this approach is the current data on the form that may not be saved to the database yet.

Hope this helps.

Wednesday, March 10, 2010

Server Error in application on navigating to Items link in Portal Integration and Partner Relationship Management Accelerators

On navigating to "Items" link in Portal Integration and Partner Relationship Management Accelerators, following error message is obtained:
Server Error in '/' Application.--------------------------------------------------------------------------------
The type specified in the TypeName property of ObjectDataSource 'ObjectDataSourceCategories' could not be found. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The type specified in the TypeName property of ObjectDataSource 'ObjectDataSourceCategories' could not be found.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: The type specified in the TypeName property of ObjectDataSource 'ObjectDataSourceCategories' could not be found.] System.Web.UI.WebControls.ObjectDataSourceView.GetType(String typeName) +1122515 System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1171 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73 System.Web.UI.WebControls.GridView.DataBind() +4 Items.Page_Load() in C:\MSA_Drop\Web\Portals\Portals\PRMPortal\PRMPortal\Items.aspx.cs:82 System.Web.Util.CalliHelper.ArglessFunctionCaller(IntPtr fp, Object o) +8 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +8664611 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

This error occurs because catalog provider is in the Fabrikam.Application.Catalog namespace, where all the other providers are without a namespace.
Therefore, to resolve the error, we need to make the following change to the Items.aspx page:

<asp:Panel ID="PanelCategories" runat="server" Visible="true"> &nbsp;<asp:ObjectDataSource ID="ObjectDataSourceCategories" runat="server" SelectMethod="GetChildCategories" TypeName="Fabrikam.Application.Catalog.Catalog">

Since we are making changes to aspx page, we do not need to re-compile the application.
Hope this helps.

Thursday, March 4, 2010

Microsoft CRM Outlook Client

Just a tip for the user installing Microsoft CRM Outlook Client for Outlook 2003. Ensure that you install the Update Rollup 7 for the Outlook client, else couple of menu items (Change Organization, Options) will not be available from the CRM menu installed.

Also, use the CRM->Options->Synchronization tab to change the duration of synchronization between MS Outlook and the web client (which is 15 minutes by default).

Get the Update Rollup 7 for Outlook Client at:;displaylang=ja&displaylang=en

Read more about synchronization of records and activities between MS CRM and Outlook at:

Unable to restart the Email Router service

Ever got 'The E-mail Router service could not run the service main background thread. The E-mail Router service cannot continue and will now shut down' while re-starting the MS CRM Email Router Service.

The trace logged is :

"System.Configuration.ConfigurationErrorsException: The E-mail router service cannot access system state file Microsoft.Crm.Tools.EmailAgent.SystemState.xml. The file may be missing or may not be accessible. The E-mail Router service cannot continue and will now shut down. ---> System.Xml.XmlException: Root element is missing."

Root Cause: The Microsoft.Crm.Tools.EmailAgent.SystemState.xml file is corrupted.

1. Browse to 'C:Program FilesMicrosoft CRM EmailService'. Delete the Microsoft.Crm.Tools.EmailAgent.SystemState.xml file.

2. Restart the Microsoft Dynamics CRM E-mail Router Service.The Microsoft.Crm.Tools.EmailAgent.SystemState.xml file is re-created.

Read more at: