"тнιѕ вℓσg ¢συℓ∂ ѕανє уσυя мσηєу ιƒ тιмє = мσηєу" - ∂.мαηנαℓу

Tuesday, 22 November 2011

Developer Toolkit For CRM 2011 Download

Microsoft released the Developer Toolkit for CRM 2011. It could be downloaded along with the latest SDK. The download link is 


The Developer Toolkit could be found in the downloaded   sdk\tools\developertoolkit   folder.

You could also find a post in this blog which does the walkthrough of the beta version of Developer Toolkit for CRM 2011.



Saturday, 5 November 2011

Customize Ribbon Tab, Group, Button in CRM 2011 OR How to insert a custom tab at Ribbon area in CRM 2011

Let's see how to customize a ribbon tab in CRM 2011 with a group and a few buttons in it. Remember there are some pitfalls while customizing ribbon tab in CRM 2011. So we are going to crack the nut.


In the following screen shot, please note the following.


1. Tab - Departments
2. Group 1- Marketing
3. Group 2.- Sales
4. Button Legal under Marketing Group
5. Button Public Relations under Marketing under Marketing Group
6. Button Customer under Sales under Sales Group





So obviously the hierarchy is 

Tab--Group--Button

So our nut is " Place a new tab for Account entity form with groups Marketing (2 buttons) and Sales (1 button)"

Lets have a look at the customization.xml. Our playground is the area under RibbonDiffXml.

To make it more simple, lets have a broad view at 4 main regions.

1. Custom Actions -- Where you could define tab, group ,button etc
2. Command definitions -Where you could define the action on the button or group
3. Rule Definitions-- Show / Hide or Enable Disable rule definitions
4. LocLabels --For Localization of labels.

So first we would have a look at the 1.Custom Actions 

Pitfall : Scaling
Scaling is one of the pitfalls.  Scaling defines how the groups are presented to the Ribbon. There is a tag called Maxsize which defines largest layout possible for a group. Now the pitfall is, if you have 2 groups you must define 2 Maxsize as shown. Otherwise it would display tab, group but no buttons on it.

Secondly, 2. Command Definitions


Please note the bridge between the Custom Action and Command Definition is Command ID.
While defining a tab, group or button we are defining a Command.

Pitfall: If you define a command for tab, group or button, you should use the same as Command ID in Command definition to define an action.

Here we are calling javascript function in Actions. You could also define DisplayRules and EnableRules if you want to.

Now we are into 3rd level , 3. Rule Definitions.


This shows how we could define the display rule for a tab. In our case we would like to display the tab ONLY on the entity form. So the context is Form

Following are possible scope of Context:

Form --For the form ribbon.

HomePageGrid---For the ribbon that is displayed for the list of records that appear in the main application navigation pane.

SubGridStandard --For the ribbon that is displayed for the list of records that appear in a subgrid in a form.

SubGridAssociated ---For the ribbon that is displayed for the list of records that appear in the navigation area of a form.



and thus we reached 4th level which is 4. LocLabels.

This is very simple and its used for Localization of labels. Remember the fact that ID is the link to refer these labels.


For your convenience, the whole code is given below.

<RibbonDiffXml>
        <CustomActions>
          <CustomAction Id="Mscrm.Isv.GlobalCustomAction" Location="Mscrm.Tabs._children" Sequence="100">
            <CommandUIDefinition>
              <Tab Id="account.DepartmentsTab" Command="Mscrm.account.DepartmentsTab" Description="$LocLabels:Account.Form.Departments.LabelText" Title="$LocLabels:Account.Form.Departments.LabelText" Sequence="1000">
                <Scaling Id="account.DepartmentsTab.Scaling">
                  <MaxSize Id="account.DepartmentsTab.Group0.MaxSize" Sequence="10" GroupId="account.DepartmentsTab.Group0" Size="Large" />
                  <MaxSize Id="account.DepartmentsTab.Group1.MaxSize" Sequence="20" GroupId="account.DepartmentsTab.Group1" Size="Large" />
                </Scaling>
                <Groups Id="account.DepartmentsTab.Groups">
                  <Group Id="account.DepartmentsTab.Group0" Sequence="10" Command="account.DepartmentsTab.Group0" Description="$LocLabels:Account.Form.Marketing.LabelText" Title="$LocLabels:Account.Form.Marketing.LabelText" Template="Mscrm.Templates.Flexible">
                    <Controls Id="account.DepartmentsTab.Group0.Controls"></Controls>
                  </Group>
                  <Group Id="account.DepartmentsTab.Group1" Sequence="11" Command="account.DepartmentsTab.Group1" Description="$LocLabels:Account.Form.Sales.LabelText" Title="$LocLabels:Account.Form.Sales.LabelText" Template="Mscrm.Templates.Flexible">
                    <Controls Id="account.DepartmentsTab.Group1.Controls"></Controls>
                  </Group>
                </Groups>
              </Tab>
            </CommandUIDefinition>
          </CustomAction>
          <CustomAction Id="Mscrm.Form.account.Legal" Sequence="55" Location="account.DepartmentsTab.Group0.Controls._children">
            <CommandUIDefinition>
              <Button Id="Mscrm.Form.account.LegalButton" TemplateAlias="o1" Image16by16="$webresource:ap_btn.png" Image32by32="$webresource:ap_btn.png" LabelText="$LocLabels:Account.Form.Legal.LabelText" ToolTipTitle="$LocLabels:Account.Form.Legal.Tooltip" ToolTipDescription="$LocLabels:Account.Form.Legal.TooltipDescription" Command="Mscrm.Form.account.Legal.Command" />
            </CommandUIDefinition>
          </CustomAction>
          <CustomAction Id="Mscrm.Form.account.PublicRelations" Sequence="55" Location="account.DepartmentsTab.Group0.Controls._children">
            <CommandUIDefinition>
              <Button Id="Mscrm.Form.account.PublicRelationsButton" Image16by16="$webresource:ap_btn.png" Image32by32="$webresource:ap_btn.png" TemplateAlias="o1" LabelText="$LocLabels:Account.Form.PublicRelations.LabelText" ToolTipTitle="$LocLabels:Account.Form.PublicRelations.Tooltip" ToolTipDescription="$LocLabels:Account.Form.PublicRelations.TooltipDescription" Command="Mscrm.Form.account.PublicRelations.Command" />
            </CommandUIDefinition>
          </CustomAction>
          <CustomAction Id="Mscrm.Form.account.Customer" Sequence="55" Location="account.DepartmentsTab.Group1.Controls._children">
            <CommandUIDefinition>
              <Button Id="Mscrm.Form.account.CustomerButton" Image16by16="$webresource:ap_btn.png" Image32by32="$webresource:ap_btn.png" TemplateAlias="o1" LabelText="$LocLabels:Account.Form.Customer.LabelText" ToolTipTitle="$LocLabels:Account.Form.Customer.Tooltip" ToolTipDescription="$LocLabels:Account.Form.Customer.TooltipDescription" Command="Mscrm.Form.account.Customer.Command" />
            </CommandUIDefinition>
          </CustomAction>
        </CustomActions>
        <Templates>
          <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
        </Templates>
        <CommandDefinitions>
          <CommandDefinition Id="account.DepartmentsTab.Group0">
            <EnableRules />
            <DisplayRules />
            <Actions />
          </CommandDefinition>
          <CommandDefinition Id="account.DepartmentsTab.Group1">
            <EnableRules />
            <DisplayRules />
            <Actions />
          </CommandDefinition>
          <CommandDefinition Id="Mscrm.Form.account.Legal.Command">
            <EnableRules></EnableRules>
            <DisplayRules>
            </DisplayRules>
            <Actions>
              <JavaScriptFunction Library="$webresource:ap_legal.js" FunctionName="Legal" />
            </Actions>
          </CommandDefinition>
          <CommandDefinition Id="Mscrm.Form.account.PublicRelations.Command">
            <EnableRules></EnableRules>
            <DisplayRules>
            </DisplayRules>
            <Actions>
              <JavaScriptFunction Library="$webresource:ap_publicrelations.js" FunctionName="PublicRelations" />
            </Actions>
          </CommandDefinition>
          <CommandDefinition Id="Mscrm.Form.account.Customer.Command">
            <EnableRules></EnableRules>
            <DisplayRules>
            </DisplayRules>
            <Actions>
              <JavaScriptFunction Library="$webresource:ap_customer.js" FunctionName="Customer" />
            </Actions>
          </CommandDefinition>
        </CommandDefinitions>
        <RuleDefinitions>
          <TabDisplayRules>
            <TabDisplayRule TabCommand="Mscrm.account.DepartmentsTab">
              <EntityRule EntityName="account" Context="Form" />
            </TabDisplayRule>
          </TabDisplayRules>
          <DisplayRules />
          <EnableRules />
        </RuleDefinitions>
        <LocLabels>
          <LocLabel Id="Account.Form.Departments.LabelText">
            <Titles>
              <Title languagecode="1033" description="Departments" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Account.Form.Departments.Tooltip">
            <Titles>
              <Title languagecode="1033" description="Departments" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Account.Form.Departments.TooltipDescription">
            <Titles>
              <Title languagecode="1033" description="Departments" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Account.Form.Marketing.LabelText">
            <Titles>
              <Title languagecode="1033" description="Marketing" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Account.Form.Marketing.Tooltip">
            <Titles>
              <Title languagecode="1033" description="Marketing" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Account.Form.Marketing.TooltipDescription">
            <Titles>
              <Title languagecode="1033" description="Marketing" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Account.Form.Sales.LabelText">
            <Titles>
              <Title languagecode="1033" description="Sales" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Account.Form.Sales.Tooltip">
            <Titles>
              <Title languagecode="1033" description="Sales" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Account.Form.Sales.TooltipDescription">
            <Titles>
              <Title languagecode="1033" description="Sales" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Account.Form.Legal.LabelText">
            <Titles>
              <Title languagecode="1033" description="Legal" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Account.Form.Legal.Tooltip">
            <Titles>
              <Title languagecode="1033" description="Legal" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Account.Form.Legal.TooltipDescription">
            <Titles>
              <Title languagecode="1033" description="Legal" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Account.Form.PublicRelations.LabelText">
            <Titles>
              <Title languagecode="1033" description="Public Relations" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Account.Form.PublicRelations.Tooltip">
            <Titles>
              <Title languagecode="1033" description="Public Relations" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Account.Form.PublicRelations.TooltipDescription">
            <Titles>
              <Title languagecode="1033" description="Public Relations" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Account.Form.Customer.LabelText">
            <Titles>
              <Title languagecode="1033" description="Customer" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Account.Form.Customer.Tooltip">
            <Titles>
              <Title languagecode="1033" description="Customer" />
            </Titles>
          </LocLabel>
          <LocLabel Id="Account.Form.Customer.TooltipDescription">
            <Titles>
              <Title languagecode="1033" description="Customer" />
            </Titles>
          </LocLabel>
        </LocLabels>
      </RibbonDiffXml>



So here is our cracked nut.







Thursday, 6 October 2011

How to set up Configuration Page of Solution in CRM 2011

As you all know, the new concept called 'Solution' which bundles the components was introduced in CRM 2011. In Solution, it is possible to set up a configuration page. Following are some of the possible options to make use of Configuration Page.

1. Branding.

2. Product Details

3. Advanced functionalities ( eg: Contract renewal ,validation etc )



The configuration page should be an HTML page. It must be uploaded to web resources. But remember you could refer other web resources from the HTML Page, which is a very good feature. For instance, if you need to display an image as a cool branding idea, you could upload the image to Web resources and then refer it from the HTML page.

Sample HTML:
<HTML>
<BODY contentEditable=true>
<P align=center>Contract Renewal</P>
<TABLE cellPadding=3>
<TBODY>
<TR><IMG src="alfapen.jpg"></IMG></TR>
<TR>
<TD align=right>Please Enter your Product Key<INPUT type=textbox name=license></TD>
<TD></TD>
<TD><button type="button">Continue</button></TD>
<TR>
</TBODY></TABLE></BODY></HTML>


In the above code the image is referred from the Web resources. There is a sample button on this html page. The logic (contract renewal, validation etc.) could be implemented for the click event of the button as per your idea. Or you could simply display the image or product details for branding

Well, look at the sky and that is the limit ! You could try some cool branding ideas which would make your solution Configuration page more attractive.

Here is a sample Configuration page.








Monday, 12 September 2011

Developer Toolkit (Beta) for CRM 2011-- A Catalyst for Dynamics CRM 2011 Development

The latest beta version of Developer toolkit(Integrated with VS 2010 IDE) for Dynamics CRM 2011 is included in the SDK. In the SDK, you could find it in the tools folder. I could see it as a catalyst for Dynamics CRM development. It saves a lot of time. Also its well structured.  Lets have a quick look at the beta version of Developer Toolkit for CRM 2011. You could find the following files in the developertoolkit folder. Installation of Developer toolkit is very easy.



You could see the following installation wizard and its super quick installation.


After installation, if you try to create a new project, you could see a section called Dynamic CRM as shown below. The ideal option would be to opt a solution. Because it would contain all the necessary elements for a Dynamic CRM 2011 project development. But choice is yours.


Next step is a connection wizard to connect to Dynamics CRM Server as shown below.


It would assume that we might need a silverlight project and displays various options for silverlight project. Again its optional.


It provides a very cool CRM Explorer. So "Dynamics CRM is visible from VS"


Lets have a look at the solution. As mentioned earlier it provides the necessary components for Dynamics CRM Development. Lets try to add a web resource.


Next step is to choose the web resource file type.



Please note the properties window of the web resource file.


In order to deploy something, you could choose the following option found on CRMPackage.




Do you think its a catalyst for Dynamics CRM 2011 Development?

Friday, 2 September 2011

Connections in CRM 2011

In simple words, 'Connections in CRM 2011' is a feature by which you could define relation between two entities ( including custom entities).
For Instance, an account namely AP could connect to a contact Mr.George as an employee(connection role).

In a connection, One record is related to another record based on a connection role.

A Connection always provides 2 options for us.

1. To Another (To another enitity record)
2. To Me (To the logged in User)

How could we establish connection from Main Page:


But the Connection button gets disabled if more than one records were selected.


How could we establish connection from Entity form:


Its possible to view all exisiting connections of a particular record by clicking on the 'Connections' left navigation item.

The key players of 'Connections' feature are 2 entities.

1. Connection Entity ( Can be customized)-Relationship between two entities.
2. Connection Role Entity( Can NOT be customized) -Role describing a relationship between a two records.




Connection Role is the key element of a Connection which makes it meaningful.

How could we configure a Connection Role in CRM 2011:


Configuring a Connection Role in CRM 2011 involves 3 steps.



1. Describe Connection Role-- This includes defining  new name for the connection role and choosing  a connection role category.

2. Select record types

3.Choose mathing Role (Optional)-- This is a kind of intellisense
For instance, If you choose Role (To) in a Connection then CRM will automatically populate the Connection Role (From) if a matching role already defined.

So lets create a Connection based on the configured Connection role.

Here we go !



How to enable Connections at Entity Level in CRM 2011:

When you create an entity, you could decide enable/ disable Connections with the following setting.




















Wednesday, 31 August 2011

Sunday, 17 July 2011

How to refer a webresource file from Javascript in CRM 2011

As we all know,  webresources utility is one of the very good features of CRM 2011.
Let's see how to refer a webresource from Javascript file in CRM 2011.

Its very simple syntax. For Instance,
Imagine that you have uploaded a webresource called new_ConfigureAttributes.xml
If you want to refer it in Javascript at some point, you could use the following syntax

var xmlPath = "../WebResources/new_ConfigureAttributes.xml";

For a detailed sample, you could have look at the following post.

Related Post :Reading an XML file in CRM 2011 using javascript http://crmdm.blogspot.com/2011/02/reading-xml-file-in-ms-dynamics-crm.html

The key advantage is that its not dependent on any folder structure and also its easy to refer it. You have a file ( could be any web resource file eg:xml, jpg,css,png etc) and you need to upload it to webresources first and then refer it from Javascript whenever required. Even if you move solution from one environment to another it would work perfectly. The reason is simple, its a direct reference to Webresources which is a part of solution. If you want to refer a webresource from Sitemap or Customizations.xml , you could refer the following post.

How to refer a webresource file from Sitemap or Customizations.xml
http://crmdm.blogspot.com/2011/02/how-to-refer-webresource-file-from.html