Category Archives: MS CRM 2011

Microsoft Dynamics CRM 2011 Customization & Configuration Certificate Guide

Yesterday I got an email from my publisher to review Microsoft Dynamics CRM 2011 Customization & Configuration Certificate Guide written by my fellow MVP Neil Benson . So I am going through this book and will post my review shortly, till then stay tuned.  

Create and attach text file to notes in Microsoft CRM 2011

If you have requirement to create and attach file to notes in Ms CRM 2011 using code then this post is for you, you can use below code string strMessage=”this is a demo”; byte[] filename = Encoding.ASCII.GetBytes(strMessage); string encodedData = System.Convert.ToBase64String(filename); Entity Annotation = new Entity(“annotation”); Annotation.Attributes[“objectid”] = new EntityReference(“EntityName”,GUID); Annotation.Attributes[“objecttypecode”] = “EntityNAME”; Annotation.Attributes[“subject”] = “Demo”; Annotation.Attributes[“documentbody”] = encodedData; Annotation.Attributes[“mimetype”]… Read more »

Retrieve primary entity and related entity data using OData in MS CRM 2011

Are you looking to access primary entity and related entity data in single query using OData then this post is for you. If we need to access related entity data, we can use expend open in our odata query, we need to specify relationship name, in below example I am fetching data from account and more address entity and relationship… Read more »

Are you sure you want to change lookup value ??

Sometime we have requirement where we need to prompt user while changing lookup value if he really wants change that value or not, especially when we need to fire some business logic on change of lookup based on it’s value. We got this requirement where we need to delete all child records when specific lookup in parent entity is changed,… Read more »

Step By Step Adding Configuration Page in Solution MS CRM 2011 Part -2

In my earlier post I have used a simple html web resource to set as configuration page and I found this post quite popular, so I thought to write another post on this. In this post I will show how can we get configuration details from xml web resource to display it in configuration page. We can use it in… Read more »

Retrieve MS CRM fields using late bound

In my earlier post I have provided sample code to set different data type fields using late bound in MS CRM 2011. In this post I am going to how can we fetch value from different data type fields. Entity _Account = service.Retrieve(“account”, new Guid(“XXXXX”), new ColumnSet(new string[] { “name”, “accountcategorycode”, “new_collectiondate”, “creditlimit”, “parentaccountid”, “new_executivecommission”, “new_isbilled” })); //To fetch string… Read more »

Working with MS CRM 2011 data types

I have seen many question in MS CRM Development where developers asking for MS CRM 2011 data type related question, like how to set lookup field, how to set/retrieve optionset value. so I thought to write code to show how we can set different data type field in MS CRM 2011. Below is the example to create account using late… Read more »

Fetch team members for selected Team

I got one requirement to get all team members based on team, so I thought to share code here so that it can help other crm developers. you can use below code private EntityCollection GetTeammembers(IOrganizationService _iService,Guid TeamID) { EntityCollection _Teammembers = null; Guid _UserId = Guid.Empty; EntityCollection col = new EntityCollection(); QueryExpression _Query = new QueryExpression(); _Query.EntityName = “systemuser”; _Query.ColumnSet… Read more »

InstantiateTemplateRequest using Javascript – MS CRM 2011

If you want to create new email using template or want to place email template contents to email while replying, you need to use”InstantiateTemplateRequest” to initiate email template. It has three below parameters TemplateId (ID of the email template that you want to use) ObjectId (associated entity record id, (for example you have used data field from user entity then… Read more »