Archive for the ‘CRM 2011’ Category

Helpful CRM 2011 JavaScript Code snippets

How to get the logical name of the entity for the current record in CRM 2011 using Javascript

Code Snippet:  var entityName =;

For instance , if the current record is contact the above code will return a string “contact”

If you want to get current user id in crm 2011 form you can use Xrm.Page.context, you have to use

getUserId() method for this you can use it like below


Categories: CRM 2011 Tags:

How to create charts in MS Dynamics crm 2011 and add them to a Dashboard?

June 20, 2011 Leave a comment

Microsoft Dynamics CRM 2011  provides a new feature to customize  visualization chart against a single entity view,  so we can see graphical representation of data using your CRM views.  This helps to analyze the data in a better manner. CRM 2011 provide 5 different type of charts namely

  • Column Charts,
  • Bar Charts, 
  • Line Charts,
  • Pie Charts and
  • Funnel Charts.

Now I am going to discuss how to create charts against a entity view. We can show graphic visualization between any two fields of an entity which are related to each other. For this purpose let us take an example to create chart for contact entity’s two fields “created on” Vs “fullname” of contact.

Now we can use following steps to create chart.

step – 1   Goto  the settings area and open your solution package.

step -2  Click on the contact entity and  double click on the chart from the left menus.

step – 3 Now we can make a new chart for contact entity.

 In above image we can see  picklist field of different view and second field for chart name  now we can select 2 fields name of entity from picklist for which want want to see chart.

Now we can see no. of contact createdon different weeks in the form of a bar chart.

Now I will be discussing how to create dashboard for charts and list?

Follow the steps below.

Step -1 Goto workplace, then to Dashboard.

Step – 2  Click the new button from Dashboard ribbon tool bar (See highlighted in the image below)

Step -3   Select the layout for dashboard.

Step -4  Please provide a name to the Dashboard. If you look closely on the dashboard section you will see 4 different images 1) Represent adding a chart 2) Represent adding a list 3) Represent adding a Web resource etc. Here we will be adding a Chart, so click on the chart image.

Step 5- On clicking the chart image a new window will open (see image below).  Now simply select an entity and view along with the Chart you want to add.  Once done click ‘Ok’ button.

Now you can see dashboard for contact entity records.

Hope this helps.

Categories: CRM 2011 Tags:

How to populate a parent form lookup field value in a child form without using fetch xml in CRM 2011

June 11, 2011 Leave a comment

If we want to retrieve data of a lookup field of parent form in a child form lookup field then we can use very easy javascript code without fetch xml in CRM 2011.

Let your parent form entity be Case(Incident) in which we need to retrieve a field name Customer of type   lookup (Having two types of values i.e. contact and account) in this lookup field.

The child  entity name casetask   having 1:N relationship(Case to Case task) and  Casetask entity has a lookup field of  Customer Contact in Casetask form so we can retrieve the custtomer data which is filled in Case entity(Customer field)  in the Casetask entity (Customer Contact  field )

So we can use  following  javascript code.

Define the function SETVALUE()

function SETVALUE()
if (Xrm.Page.ui.getFormType() == 1)  //Check if  form is in create mode
var oType =crmForm.ObjectTypeCode;
if ( != null)
if ( ( != null) &&
    ( != null) &&
    ( != null) &&
    ( != null)) // Check if parent form is null
var parentForm =;
if (parentForm.ObjectTypeName == “incident”) // Check if parent form type is same or different
var lookupData = new Array();
var lookupItem= new Object();

if (parentForm.all.new_customerid.DataValue && parentForm.all.new_customerid.DataValue[0].id  ) //Check parent customer id field is not null 
var contactname   = parentForm.all.new_contact.DataValue[0].name  ; parentForm.all.new_contact.DataValue[0].id ; = contactname ;
lookupItem.entityType = “contact” ;
lookupData[0] = lookupItem;
Xrm.Page.getAttribute(“new_customerid”).setValue( lookupData );                


Categories: CRM, CRM 2011 Tags:

How to add a subgrid in a crmForm for displaying related records in crm 2011

June 8, 2011 Leave a comment

CRM 2011 brings along really cool and easy to use features. Today we will talk  about one of them and that is, how to show a sub grid of a related entity on a master entity.

How does it help to show related entity grid on a CRM 2011 form?

The answer is simple, it is all about usability if you can see all the communication activities of a contact on the same form without clicking or going to a new tab isn’t it wonderful. It saves you time and improves user experience.

How to do it?

Let us take a scenario to answer this question. Suppose you have an entity in CRM 2011 by name Organization now you want to show all employees of this organization in a sub grid on organization entity. For doing so please follow the following steps

1- Go to your solution and open organization entity form as shown in the image below

Image 1

CRM 2011 Form Customization screen

Customization screen

2- Now goto insert tab in left top of the organization form as shown in image below.



3- Click on the subgrid button.


How to add Sub Grid

4- select tab  in which you want to add subgrid.


5- After clicking on the subgrid button (that appears on the top of the form) you will see it requires the following

Name ,Label,checkbox for display label on the form and in the datasource section you can see

1- Picklist of records (select only related record ).

2- Entity picklist(for which you want to add picklist).

3.Picklist of different views you can select according to your need.Edit and New button are also available if you want to update or make a new view as per your requirements

Now you can select different checkbox from Additional options section according to your need


Hope this helps

Categories: CRM 2011 Tags:

Microsoft Dynamics Sure Step Methodology

Microsoft Dynamics Sure Step gives you a complete methodology-including project management discipline and field-tested best practices-plus user-friendly tools that enable you to more successfully deploy, migrate, configure, and upgrade Microsoft Dynamics solutions, including Microsoft Dynamics CRM. The Sure Step Methodology is available to Microsoft Partners and helps you reduce risk and make deployment and configuration of Microsoft Dynamics solutions much more predictable.Sure Step is the project management Process for Microsoft for Dynamics Projects. Like any other Software Process, Sure Step tells you WHO shall do WHAT and in WHICH ORDER and who is RESPONSIBLE for what. So a software process can be seen as the sum of years of knowledge and best practice in software development. Sure Step defines process phases, milestones roles, artifacts, cross-phase-processes and additional project management processes. Sure Step supports a broad range of products: Dynamics AX, Dynamics NAV, Dynamics GP, Dynamics SL and Dynamics CRM. And different project types: Full Implementation, Rapid Implementation, Optimization and Upgrade. Products and project types can be combined. Microsoft provides the Sure Step Overview Diagram for sales and training situations. Assuming that this is a “Training Situation” I have uploaded the Overview Diagram.

The Process Guide

Microsoft provides both, an electronic process guide, and an editor. The process guide is an HTML Project combined with ActiveX Elements. It is possible to filter the process guide content with the ActiveX Filter. Internet Explorer is required to view the process guid properly. The Editor is part of the Sure Step Package. It allows you to tailor the process to your needs. I’ve encountered several problems running the editor on a non-English windows version. Generating the static content breaks with an error message that some path cannot be found. Solution: Setup an English windows on a virtual pc image and edit the content there.


Sure Step defines 6 Main Phases and 2 additional phases for optimization and upgrade. It covers the complete lifecycle from project initiation, development, deployment, optimization and upgrade to the next version. A phase ends with a milestone. A milestone is a sum of artefacts created or refined in the phase. If the milestone is accomplished you may start the next phase. At the first look the phases look like a waterfall model, but of course Sure Step isn’t waterfall. Cause waterfall do not works in reality.

Sure Step Phases:

Diagnostic: The diagnostic phase contains analysis of the customer process at a very hi level. Focus of the diagnostic phase is the project initialization; To setup a project plan, agree on an approach and scope definition.

Analysis: In the analysis phase most of the business processes are identified and documented at a high level. If necessary an external specialist helps you to do so. Goal of the analysis phase is to understand the customers business and processes performed. Modeling and documenting the customers business is important. Microsoft Provides a new tool for the modeling: Microsoft Sure Step Business Modeler

Design: Main purpose of the design phase is to find a way how the customers’ processes and needs can be implemented with Dynamics. At this point there may be more than one solution for a topic. You need to identify the best strategy for the implementation phase. Although prototyping is not covered in sure step, this is the point where to build prototypes and do load testing on the prototype implementation.

Development: Most of the programming work is done in the development. Development covers the creation of new features and adaption of existing features as well as the data migration. All features and the data migration has to be tested. Beside feature and data migration testing it is necessary to do security testing. The phase ends when most of the specified features are developed and tested and the data migration is done.

Deployment: Goal of the deployment phase is to setup the operational dynamics environment at the customer. Beside installation, configuration and feature deployment, the phase focuses on testing at system level. So you have to run the user acceptance tests, process tests, security tests and load tests as defined in the test plan. When the system runs and all tests pass the deployment phase is finished.




Cross Phase Processes

While a Phase is a view on the process between milestones, a cross phase process is a view on the process for a specific software engineering discipline. Like the name suggests Cross Phase Processes are performed in several phases. In general, most Cross Phase Processes are performed from project start to end. Without the Management Disciplines, Sure Step defines 8 Cross Phase Processes

Business Process Analysis


Data Migration







Sure Step defines 20 different roles and divides them in “Consulting” and “Customer” roles. Sure Step gives hint what skills are necessary to fulfill a role and typical tasks for the role. A role can be performed by more than one person, eg. there may be more than one Development Consultant. A person may perform more than one role, eg. a consultant may be both Application- and Development Consultant.

Consulting Team: Sales

Executive Sponsor

Account Manager

Sales Representative

Technical Sales Specialist

Consulting Team: Project

Engagement Manager: The Engagement Manager participates only in the starting phase of a project. He is responsible to transfer a sales project into a implementation project.

Project Manager: The project manager is what the name suggests; The project manager. He keeps the project running, allocates resources, maintains the project plan, work break down structure and is the contact person for the Customers project manager. The Project manager has a representative function and coordinates meetings with several team members.

Business Analyst: The BA is a specialist on a certain domain, like production, financial, etc. He supports the project team during the Diagnostic and Analysis Phase. He is responsible for outlining existing processes at the customers company. In the Analysis phase the process knowledge is transferred from the Business Analyst to the Application Consultant.

Application Consultant: The Application Consultant has a deep knowledge of the Dynamics System and modules. He takes part in every project phase from diagnostic to deployment, optimization and upgrade. His main purpose is to bring the customer processes into a Dynamics like form. Optimizing existing processes to fit the Dynamics built in processes and defining new processes.

Solution Architect: The Solution Architect in Sure Step is described somehow as the God of Dynamics. He knows everything! The Solution Architect has a deep knowledge of Dynamics as well as Development in Dynamics. He is familiar with .NET, Visual Studio, BizTalk, Windows Server Systems and of course Database Systems. He knows about the technical aspects about Application Integration, Web services as well as the benefits of a service oriented architecture. By the way the Solution Architect has also skills in business modeling and software documentation.

Development Consultant: The Development Consultant realizes the requirements in Dynamics. He is an expert in Dynamics Development and Development Tools. The Development Consultant has a broad knowledge about .NET and Development with other Microsoft Products. He is familiar with the Microsoft Software stack from Operations Systems and Servers, to Database Servers and SharePoint, BizTalk, etc.

Technology Consultant: The Technology Consultant can be described as a kind of Administrator. He has a deep knowledge on installing and configuring Microsoft Products and especially Dynamics Software. He is responsible for setting up a production, development and testing environment. The Technology consultant is also a networking specialist.

Support Engineer


Executive Sponsor

Business Decision Maker

Purchase Manager

Project Manager

IT Manager

IT Team Member

Key User

End User

Categories: CRM, CRM 2011 Tags:

How to do a filter lookup on entity with 1:N relation in CRM 2011?

May 16, 2011 Leave a comment

Hi Guys, was just wondering if the filtered lookup have been provided by the standard CRM 2011 system out of box. Just found some days back while I was implementing a requirement for a new client so thought to share it with you all.  Follow the steps below for magic to unwind.

For filtering lookup field of contact related to the parent Customer(Account)
we use the following step for filtered record in this field.

step1-Go to the form of the customize entity and open Primary contact lookup field.

step 2-Go to the related record filtering section of the field property. Here you can see only show record where condition-you select Contact(Parent Customer (Accounts)) and select current record and you can also  allow user turn off filtering by using check-box. Allow user to turn off filter.

step 3- you can also select different  view from the view selector property of the field

After this save the form and publish the customization and you can see the magic that record filtered from the parent contact.

Hope this helps

Categories: CRM 2011 Tags:

How to add JQuery support to CRM 2011?

Last night I spent couple of hours trying to debug a JQuery code in MS CRM 2011 which was not working as expected. After debugging I realized that JQuery native support is not available in microsoft CRM 2011. This was the exact reason why the Javascript was unable to recognize ‘$’ symbol and ribbion stopped showing on CRM 2011 page.  The easiest way to get this working is by creating a web resource and adding Jquery min file to it.

Do the following

  1. Go to http://jquery.comand then to Download
  2. find the latest Jquery min (select the minified version, at the time of writing was the latest)
  3. Now go to CRM 2011 and create a web resource
  4. Add the new Web resource by name JQueryMin1.6.1 (JQuryMin<Verion>)
  5. Upload the Downloaded file to JQuery to this web resource.
  6. Now add this web resource to which ever form you want to use JQuery api

Hope this helps.

Categories: CRM 2011, JQuery Tags: ,
%d bloggers like this: