Wednesday, December 30, 2009

Add Reference to CRM dlls in VS 2008

Inorder to add reference to the CRM dlls in VS 2008 projects with ease, copy the
microsoft.crm.sdk.dll and microsoft.crm.sdktypeproxy.dll to the location found in the string value "All Assemblies In" of the Registry Key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\v3.5.

Tuesday, November 3, 2009

Customization import issue

CRM Error Detail

Failure: new_a: An entity with the specified name already exists. Please specify a unique name.

Exception Details

Event Type: Error
Event Source: MSCRMWebService
Event Category: None
Event ID: 19457
Date: 11/2/2009
Time: 12:54:52 PM
User: N/A
Computer: X
Description:
Customization Import failed. Error: Entity with id f3ee04fd-0c82-4b8d-bfe2-9e53048cdd7a already has the label Entity1 for column LocalizedName and language 1033 - update entity with id ec7aa714-7cdd-4ec4-ae57-bef3288c93ec cannot have the same label

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Reason
An entity with the same display name as that of new_a entity (ie Entity1) exists already, even though the entity's schema name is different from new_a.

Solution
Change the display name of the existing entity or the entity being imported.

Sunday, November 1, 2009

Getting MS CRM 4 form menu item positions

A javascript tool to help one identify the position of CRM menu items on the crm form.

Once the position number is identified, one can do the following
1. Either set any property for that item like hiding a menu item
2. or get to know the available properties of a menu item through VS quick watch.

Deployment steps
1. Copy the html and js files to ISV folder
2. Insert the following line in the on load event of the required entity.
window.open('/ISV/DisplayMenuItemPostion.html');

To download click here

Friday, October 9, 2009

Workflow Issue & Solution

The solution for the workflow issue mentioned below is just restarting the Microsoft CRM Async Service.
This is because the strong key file has changed but it has not been effected in CRM system, thus it requires a Async service restart.

ErrorCode -2147201001

Workflow paused due to error: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Workflow.Runtime.Hosting.DefaultWorkflowLoaderService.CreateInstance(Type workflowType) at System.Workflow.Runtime.WorkflowDefinitionDispenser.LoadRootActivity(Type workflowType, Boolean createDefinition, Boolean initForRuntime) at System.Workflow.Runtime.WorkflowDefinitionDispenser.GetRootActivity(Type workflowType, Boolean createNew, Boolean initForRuntime) at System.Workflow.Runtime.WorkflowRuntime.InitializeExecutor(Guid instanceId, CreationContext context, WorkflowExecutor executor, WorkflowInstance workflowInstance) at System.Workflow.Runtime.WorkflowRuntime.Load(Guid key, CreationContext context, WorkflowInstance workflowInstance) at System.Workflow.Runtime.WorkflowRuntime.GetWorkflowExecutor(Guid instanceId, CreationContext context) at System.Workflow.Runtime.WorkflowRuntime.InternalCreateWorkflow(CreationContext context, Guid instanceId) at System.Workflow.Runtime.WorkflowRuntime.CreateWorkflow(Type workflowType, Dictionary`2 namedArgumentValues, Guid instanceId) at Microsoft.Crm.Workflow.WorkflowHost.StartWorkflowFromType(Guid instanceId, Type workflowType, WorkflowContext context) Inner Exception: System.IO.FileLoadException: The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at Compiled.Workflowa09e92b8c5b4de11818d0800279388db.InitializeComponent() at Compiled.Workflowa09e92b8c5b4de11818d0800279388db..ctor()

Workflow Issue & Solution

The solution for the workflow issue mentioned at the end is as as follows
  1. Remove the existing strong name key file from the workflow assembly code.
  2. Add a new strong name key file.
  3. Compile the workflow assembly.
  4. Register the workflow assembly in database mode.
  5. Restart the CRM async service
ErrorCode - 2147201001

Workflow paused due to error: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Workflow.Runtime.Hosting.DefaultWorkflowLoaderService.CreateInstance(Type workflowType) at System.Workflow.Runtime.WorkflowDefinitionDispenser.LoadRootActivity(Type workflowType, Boolean createDefinition, Boolean initForRuntime) at System.Workflow.Runtime.WorkflowDefinitionDispenser.GetRootActivity(Type workflowType, Boolean createNew, Boolean initForRuntime) at System.Workflow.Runtime.WorkflowRuntime.InitializeExecutor(Guid instanceId, CreationContext context, WorkflowExecutor executor, WorkflowInstance workflowInstance) at System.Workflow.Runtime.WorkflowRuntime.Load(Guid key, CreationContext context, WorkflowInstance workflowInstance) at System.Workflow.Runtime.WorkflowRuntime.GetWorkflowExecutor(Guid instanceId, CreationContext context) at System.Workflow.Runtime.WorkflowRuntime.InternalCreateWorkflow(CreationContext context, Guid instanceId) at System.Workflow.Runtime.WorkflowRuntime.CreateWorkflow(Type workflowType, Dictionary`2 namedArgumentValues, Guid instanceId) at Microsoft.Crm.Workflow.WorkflowHost.StartWorkflowFromType(Guid instanceId, Type workflowType, WorkflowContext context) Inner Exception: System.TypeLoadException: Could not load type 'M.C.Workflow.StartChildWorkflow' from assembly 'M.C.Workflow.SubscriptionWorkflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=99c841002e45ae51'. at Compiled.Workflow9073d7dbc4b4de11818d0800279388db.InitializeComponent() at Compiled.Workflow9073d7dbc4b4de11818d0800279388db..ctor()