Wednesday, June 30, 2010

Error publishing Workflows with 'Send Email' step (CRM 4.0)

You might encounter an error while trying to publish workflows with an 'Email Step' added
Error : "An error occured when the workflow was being created. Try to save the workflow again."

The crm logs shows the error as
"Type System.Globalization.CultureInfo is not marked as safe ... in web.config"

Here is the resolution
Add the below entry into the web.config file available in the crm installation directory
Eg : c:\program files\microsoft dynamics crm\crmweb

<authorizedType Assembly="mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Globalization" TypeName="CultureInfo" Authorized="True"/>

Try publishing the workflow again. That should work  :-) !!

Saturday, April 24, 2010

Update Rollup 10 - Microsoft CRM 4.0

Update Rollup 10 for Microsoft Dynamics CRM 4.0 is available
This is a tested, cumulative set of updates for Microsoft Dynamics CRM 4.0. It includes performance enhancements that are packaged together for easy deployment.

Click here to download

Thursday, April 15, 2010

Invalid Argument Error Scenarios - MSCRM 4.0

There are a couple of scenarios, which could generate the above error

 When you create a new record or open an existing record in Microsoft Dynamics CRM 4.0
When you create a new record that contains a date of January 1 in Microsoft Dynamics CRM 4.0, you receive the following error
Invalid Argument
Error code: 0x80040203

This problem also occurs if you open an existing record that contains a date of January 1 after you update from Microsoft Dynamics CRM 3.0 to Microsoft Dynamics CRM 4.0.
The error message might resembles like the one below
Crm Exception: Message: GetDaylightChanges actual year: 2005,
MinValue.Year: 2006, MaxValue.Year: 9999, ErrorCode: -2147220989,
InnerException: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: GetDaylightChanges actual year: 2005,
MinValue.Year: 2006, MaxValue.Year: 9999
View the Resolution at

When you import customizations in Microsoft Dynamics CRM 4.0
Here one might come across an error like "Failure: bulkoperation: Invalid Argument"
This problem occurs if you import customizations from a server that has been upgraded to Microsoft Dynamics CRM 4.0 from Microsoft Dynamics CRM 3.0.
View the Resolution at

Apart from the above you might also come across an error like "Failure: <relationshipname>: Invalid Argument"
This usually occurs when you try to import a customization file which was exported from a CRM server, which had some unpublished customizations

The Suggested approach would be to search for the relationship name in the customization xml file and find the 2 related entities involved in the relationship. Publish these 2 entities OR  all the entities (preferable) on the source CRM Server and Export them again. That should fix the issue.

If the issue remains consider editing the customization xml file directly. Search for the relationship name in the customization xml file. You will come across a node like the one below in this errorous relationship node.
<field name="aar_contractsignatoryid" requiredlevel="none" imemode="auto" lookupstyle="single" lookupbrowse="0">
  <displaynames />

You will notice that the ‘displaynames’ node is empty. You can try replacing this node with the one below
<displayname description="Test Description" languagecode="1033" />
Make sure you use the appropriate languagecode based on your CRM deployment.
Try importing this file.

Friday, November 6, 2009

Microsoft CRM Update Rollup 7 Released

The Microsoft CRM Team released the Microsoft Dynamics CRM 4.0 Update Rollup 7 on Thursday, October 22, 2009

To download click here
More Information available here

Microsoft Dynamics CRM 4.0 SDK Updated (4.0.10)

New Additions:

•Using the Paging Cookie – Fetch and QueryExpression sample code to show you how to implement paging.
•Using Pre-generated XmlSerializers – use these supplemental assemblies to increase performance.
•Visualizations (Charts) – This exciting new charts are available for Microsoft Dynamics CRM Online only.
•Walkthrough: Creating and Registering a Custom Workflow Activity – if you are new to custom workflow activities, this walkthrough will get you started.
•Authentication with CRM Online – these samples have been updated to get the organization-specific CrmService Web service URL from the discovery service.
•Using Filters in a Report – new information about enabling data pre-filtering on reports.
•Stylesheet samples – added HTML, CSS, and image files that provide a starting point for creating Web pages that look similar to Microsoft Dynamics CRM.
•Import/Export (Customization File) Schema – updated the customization schemas to be used with the latest releases.
•PluginRegistration tool – includes the latest version of this tool used for plug-ins and custom workflow activities.
•Choosing Between the WSDL and Assemblies – read this new topic to help you choose the best method for your project

here to download

Wednesday, October 21, 2009

Notes and Attachments

Almost every Entity in CRM has support for Notes and Attachments.
A Note could be almost any piece of text which does not fall under any of the CRM Activity types.(phone,fax,email etc.)
Attachment lets to attach any kind of documents (doc,xls,pdf,image files etc) to a particular record in CRM.

The Notes tab in CRM, allows you to create just a note, however if you need to create a note with an attachment, you will need to browse to Actions-&gt;Attach a Note on the menubar of the particular record.

All Notes go into the annotationbase table on the CRM DB.
Even attachments if any, associated with a note are stored in this table.
This architecture allows the attachements to the accessed even via the Outlook Client in Offline mode.

Imp: Only 1 file can be attached per Note.

Create Notes using the CRM SDK:
//Create a simple note
annotation note = new annotation();
note.notetext = "This is a note";
EntityNameReference entRef = new EntityNameReference();
entRef.Value = "account";
note.objecttypecode = entRef;
note.objectid = [GUID of the account record];

//Create note with an attachment
annotation note = new annotation();
note.notetext = "This is a note";
EntityNameReference entRef = new EntityNameReference();
entRef.Value = "account";
note.objecttypecode = entRef;
note.objectid = [GUID of the account record];
Guid noteID = crmService.Create(note);

UploadFromBase64DataAnnotationRequest uploadFile = new UploadFromBase64DataAnnotationRequest();
uploadFile.AnnotationId = noteID;
uploadFile.FileName = "Example.txt";
uploadFile.MimeType = "text/plain"; //Other possible values 'application/msword' for word doc
//Since this file would be stored in the CRM DB, the file must be converted to a base64 encoded string
uploadFile.Base64Data = GetBase64StringFromFile("Example.txt");

private static string GetBase64StringFromFile(string filename) {
using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read)) {
using (BinaryReader reader = new BinaryReader(fs)) {
byte[] fileContent = reader.ReadBytes((int) fs.Length);
return Convert.ToBase64String(fileContent);

//Retrieve Attachment from CRM
On the CRM domain one can use the below url to download an attachment directly from the CRM Server
http://[server:port]/[organization name]/Activities/Attachment/download.aspx?AttachmentType=5&amp;AttachmentId=[Annotation ID]

The above url will prompt the user to either Open or Save the the particular attachment.

//The below SDK approach can also be used to download an attachment
Private byte[] GetAnnotationAttachment(Guid annotationId){
Guid attachid = annotationId;
//Pass the Annotation attachment OTC and the Annotation ID
http://[server:port]/[organization name]/Activities/Attachment/download.aspx?AttachmentType=5&amp;AttachmentId=[Annotation ID]
System.Net.WebClient myWebClient = new System.Net.WebClient();
myWebClient.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
return myWebClient.DownloadData(url);

byte[] exampleByteArray1 = GetAnnotationAttachment(new Guid("D7D5E13B-E3B4-DE11-A647-00012E0B81A2"));
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Transfer-Encoding", "binary");
Response.AppendHeader("content-disposition", "attachment; filename=" + "Sample.xls");

Thursday, October 15, 2009

Microsoft CRM 5.0 ..... On Your Way

CRM5 is currently on the way and most likely to be shipped sometime in early 2010.
(CodeName :  Microsoft Dynamics CRM “V.Next”)
So what can we expect...... read below for the answers

New Features for Users

Enhanced Navigation
CRM5 uses the same "Fluent UI" (aka the Ribbon) as Office 2007. This new "command bar"
replaces the CRM 4.0 "tool bars" at the top of each page, and is
context sensitive. In addition, the "command bar" is fully
customizable and you can add your own buttons much like you can with ISV.Config
file today.

No more Tabs
The form model in CRM 4.0 made use of tabs to divide a form into multiple
In CRM5 tabs are displayed in the same way as section, with each form just
having a single, scrolling page.

Grid Filtering
Apart from sorting, CRM5 now allows filtering on any available column in
the Grid, much like Excel
Possibly there would be an option to save the filtered view as well.

In-line Visualizations
CRM5 allows you to visualize numeric data using in-line charts
within the form itself. This is not SQL Server Reporting Services, but looks
very much like the .NET charting solution from Dundas.
One can select a number of different chart formats such as Bar, Column, Funnel, Line, Pie & Scatter.

Team Ownership
CRM5 now also supports Team Ownership apart from the already existing ones (User owned and Organization owned). A good needed feature indeed.

Sharepoint Integration
Integration with Windows Sharepoint Service now comes Out of the Box
This includes document management, which includes site and document library
provisioning, document metadata, item security, and check-in/check-out

CRM5 now seems to support the "Add to Queue"
command, from which we believe the one should be able to add any entity
(including custom entities) to a Queue.

New Features for Administrators

Form  Layout
More flexibility has been added to Form Design, wherein Administrators can
now position sections side-by-side, field label can be positioned on the
top,left , right for any control
But the one below takes the icing on the cake.
Inline Child Grids are now supported OOB for related child entities. You now
don’t need custom coding to make this work.

Filtered Lookup
Finally one of the most desired feature since the 1.2 release, has made its
presence available in CRM5.
A lookup can now be customized to display data from any pre-defined view or
filter by related lookup on the same form.

Form Headers & Footers
Since all fields,sections,tabs now come on a single page,  a form could become quite long, and scrolling to find the required fields  could be a headache.
CRM5 now supports placing the commonly required fields on the header or footer, so that they will always be displayed regardless of the

Solution Management
With CRM 4.0, you had to implement a manual process when customizing your
solution, to make sure that you didn't overwrite previous customizations, or
disrupt any 3rd party ISV solutions. In CRM5 we had now added the concept of

      A solution is a defined set of entity customizations, workflows, e-mail
      templates, security roles, plug-ins etc. that can be managed as a single
      unit. Each solution is version controlled so presumably your can have
      multiple versions of the same solution installed, and roll-back to a
      previous version if necessary.

      You can also define solution dependencies where one solution can only be
      installed if another solution is also installed. For example, you might
      have a base solution for your whole organisation, with a departmental
      specific solution built on top of it.

      Namespace collision is avoided by defining publishers, with each publisher
      having a unique namespace. This avoids the common issue where the
      default namespace "new_" is used for all customizations, leading to
      potential namespace conflicts.

      One final plus point is that you can now specify which attributes will be
      exported as part of a solution, rather than having no choice but to export
      the whole entity.

Global Picklists
With CRM5, you now have the option of defining a Global Picklist,
which can be used across multiple forms.

Drag & Drop Form Editor
One of the most time consuming customization tasks in CRM 4.0 is the form
design. Every time you want to add, remove or re-position tabs, sections and
attributes, you have to go through a multi-click process. With CRM5, you can
now drag and drop all elements of a form, speeding up the process considerably.

Audit functionality on attribute level, it seems now comes OOB.
An Auditing  field now appears within the
Attribute setting, which can be set to True or False.

New Features for Developers

Custom Code Sandbox
There is a new server role for running custom plug-in code and custom
workflow activities without requiring full trust. This means that it will be
possible to run custom code in the CRM Online environment and achieve true
parity between On-Premise, Partner-Hosted and Microsoft-Hosted deployments.

Plug-In Transaction Support
In CRM 4.0 you could register a plug-in to run either before (pre-event) or after (post-event) the CRM platform
operation. However, you were not able to run as part of the transaction itself,
so you had to right your own compensation logic in the event the CRM platform
operation failed. CRM5 addresses this limitation and you can now choose to
register you plug-in as part of the platform operation. The CRM5 plug-in
registration tool has been modified to support this.

Automatic Plug-In Profiling
CRM5 will keep track of how a plug-in is
executing, what resources it consumes, if it is causing unexpected exceptions
and whether or not it is violating security constraints. If a particular
plug-in fails a number of times it is automatically disabled from executing,
helping to maintain system integrity.

Related Videos
BB08 Microsoft Dynamics CRM: The Appealing Business Application

BB32 Microsoft Dynamics CRM: Building Line-of-Business Applications

Courtesy :