Friday, 14 September 2012

Comparing Ribbon Workbench and Visual Ribbon editor

 

You can download Ribbon Workbench from

http://www.develop1.net/public/page/Ribbon-Workbench-for-Dynamics-CRM-2011.aspx

You can download Visual Ribbon Editor from

http://crmvisualribbonedit.codeplex.com/

1) Visual Ribbon Editor is available as executable file whereas Ribbon Workbench is a managed solution.

2) In Visual Ribbon editor you cannot customize system buttons whereas in Ribbon Workbench you can.

3) In Visual Ribbon editor you have a simple button whereas in Ribbon workbench you can add split button, flyout and different options are available. The Visual Ribbon Editor Tool allowed the simple addition of buttons and groups to existing tabs, but any more complex scenarios such as drop down menus, changing the ‘out of the box’ ribbons or adding new tabs was confined to the realms of editing page upon page of hard to understand xml which is now possible with Ribbon workbench.

4) In Ribbon workbench you have to specify a solution whereas in visual ribbon editor you only specify the organization.

5) Visual ribbon editor seems to be faster in updating the changes.

Please feel free to update this blog with your experiences

Friday, 31 August 2012

Dynamics CRM 2011 – Change execution time of Recurring System Jobs

Recently, I needed to change the time for asynchronous Goal Roll-up job. Dynamics CRM allows us to adjust the frequency in hours for this job via System Settings – “Goals” tab. Over here we are having two options, roll-up expiration time in days & roll-up recurrence frequency in hours (by default 24 hours).

image

What I wanted to do is to change the time for Goal roll-up execution, say configure the execution time to mid night or in off hours. Now, the question from where can I validate the current execution time?

You can validate the execution time of all recurring system jobs from Settings tab – System – System Jobs

image

Change the view to Recurring System Jobs, as highlighted in below screenshot

image

Here, in above scenario Goal Roll-Up system job is executing everyday on 12:30 PM. Back to my concern, I would like to change this time to mid night or to off hours. So, how to change the time?

Solution

You can change the execution time for Goal Roll up System job by updating its entry directly from SQL which is an unsupported way.

To implement this first of all find out the AsyncOperationId of the job you want to update.

SELECT [MessageName]      
      ,[OperationType]
      ,[RecurrencePattern]
      ,[Name]
      ,[PostponeUntil]      
      ,[RecurrenceStartTime]
      ,[StatusCode]
      ,[AsyncOperationId]
      ,[CorrelationUpdatedTime]
  FROM [Your_ORG_Name_MSCRM].[dbo].[AsyncOperationBase]
  WHERE OperationType=40 and StatusCode=10

In our case the operation type is 40 for Goal Roll Up. To get required Operation Types and Status code you can refer below MSDN link.

http://msdn.microsoft.com/en-us/library/gg309649.aspx

Get the AsyncOperationId and execute the below update query



Update [Your_ORG_Name_MSCRM].[dbo].[AsyncOperationBase] set
RecurrenceStartTime = '2011-12-09 00:00:00.000',
postponeuntil = '2013-02-02 00:00:00.000'
WHERE AsyncOperationid = '4D1D25D5-8A71-4E31-BAB5-D1866147E5DB'

Note : In above queries replace “Your_ORG_Name_MSCRM” with your database name. 


In above query “Postponeuntil” is the date time field which indicates when the next this job will run. It is in UTC format. So suppose, for GMT + 5:30 time zone (India time zone) if I want to schedule Goa Roll Up job then the value of this field should be set as specified above i.e." 2013-02-02 00:00:00.000”

“RecurrenceStartTime” field which will be used to set next runtime of job. Here the date part is not important as long as it is set in the past.

In below screenshot you can verify that I have successfully updated the roll up time to 5:30 AM.

image

Friday, 17 August 2012

Steps to change Server URL/Machine name after deploying Dynamics CRM 2011

Recently, I came across a situation where I needed to rename my development machine having MS Dynamics CRM 2011 & SQL server 2008 installed on it. If you change the machine name casually then you will not be able to browse any of the existing organizations. Also, the CRM Asynchronous service won’t be started.

Ideally, there are only 3 simple steps, which if followed correctly, can bring all Organizations again up & running with a new url. Below are the steps –

Word of Caution: Please take backups of your registry and Database before making any change to them or take help of the concerned Administrator to help you.

1. Rename the Machine

  • Rename the Machine and change it IP Address if required.
  • Restart the machine.

2. Update the Registry entry

  • Open the Registyr Editor using - Start > Run > Regedit.exe
  • Then Move to KEY_LOCAL_MACHINE\Software\Microsoft\MSCRM node and
    • Double Click on configdb key and change the DataSource from OldServerName to NewServerName
    • Double Click on ServerUrl key and change the URL to point to the NewServerName

3. Update the details in MSCRM_CONFIG database

  • Open SQL Server Management Studio and run the below script -
USE [MSCRM_CONFIG]
GO
 
UPDATE [Server] SET [Name] = 'NewServerName';
 
UPDATE ConfigSettings SET [HelpServerUrl] = 'http://NewServerName:5555/';
 
UPDATE Organization SET
[ConnectionString] = REPLACE([ConnectionString],'OldServerName ','NewServerName’),
[SqlServerName] = 'NewServerName ', 
[SrsUrl] = 'http://NewServerName /reportserver';


  • Restart the machine.

Disclaimer: Following of the above steps is purely the reader’s sole decision and in no case the author could be held responsible for loss of any kind arising after following.

Referred Link:

http://weblogs.asp.net/navaidakhtar/archive/2012/03/09/Microsoft-Dynamics-CRM-2011-_2F00_-4.0-Configuration-in-Case-of-Machine-rename-_2F00_-CRM-Database-server-change-_2F00_-Domain-Controller-Change.aspx

Saturday, 11 August 2012

A new add-on Dynamics CRM 2011 - Registered Events

 

We are pleased to announce our new add-on of Dynamics CRM 2011 – Registered Events.

Please visit below link to get more details about this add-on.

http://www.inkeysolutions.com/DynamicsCRMAddOns.html

Friday, 27 July 2012

CRM 2011–Managed Solution–Transport Gotchas


Today, I would like to share some gotchas of managed solution while transporting the customization changes on another organization:

1. You cannot activate/deactivate the views and transport the same status on production server via overwriting the managed solution.

2. You cannot setup default public view and transport the same status on production server via overwriting the managed solution.

3. Similarly, you cannot setup default dashboard and transport the same status on production server via overwriting the managed solution.

4. To expand or collapse tabs on forms, like you cannot expand Notes & Activities tab although you tick “Expand this tab by default” on entity form.
In a same manner, you cannot collapse the tabs like General, Notes & Activities etc. although you unchecked “Expand this tab by default”.

5. Start Auditing on any of your entities is not being transported on production server.

The above points are in my knowledge. Please feel free to append this list with your experiences as well.

Thursday, 19 July 2012

Dynamics CRM 2011 - Odd behaviour of Product default lookup view on Order Product record

Yesterday, I faced a weird behaviour of order product entity on production server & in fact did not visualize the same during development phase. This is related to a default lookup view of existing product on Order Product entity record.

In Dynamics CRM a default lookup view for this entity is “Products in Parent Price List”. Means you will only be allowed to select the products of Price List that was selected on Order record (Parent record). On yesterday I found that the default view was changed to “Product Lookup View” and it now allows you to select products of all Price Lists. Weird….

After goggling for an hour I came to know that this is because I wrote some JavaScript code on change event of this lookup field to do some calculation of pricing based on product selection. So when you write custom code on the OnChange event of such "special" lookups CRM loses its normal behaviour.

Workaround

  • Create a new temporary unmanaged solution on development organization.
  • Add an Order Product entity to this solution.
  • Export this solution as unmanaged.
  • Unzip the customization files.
  • · In customiztaion.xml, change the default view GUID back to “Products in Parent Price List” ({BCC509EE-1444-4A95-AED2-128EFD85FFD5}) by replacing the current GUID of “Product Lookup” ({{8BA625B2-6A2A-4735-BAB2-0C74AE8442A4}}).
  • Import the solution back to the development organization & publish the changes.
  • You can now validate the default lookup view for Product lookup.
  • Now, export your original unmanaged solution as Managed to be imported on production server.

Referred links

http://social.msdn.microsoft.com/Forums/en-US/crm/thread/5eac1b84-ca66-41ba-9da7-06bbc49ffdad#e6908e92-e5a5-4d57-bc54-2fcaf393b7e2 

http://blogs.msdn.com/b/apurvghai/archive/2012/02/15/exisitng-product-lookup-lists-all-the-products.aspx

Friday, 13 July 2012

Applying Dynamics CRM 2011 styles to a Silverlight application

In this post we will discuss how we can apply CRM styles to different Silverlight controls like button and datagrid.

First we will have a look how to apply styles in Silverlight application.

For styling a Silverlight application we cannot use CSS which is mostly used for styling web applications. Silverlight offers two styling method implicit styling and explicit styling.

In Implicit styling you can specify the style as given below:-
<Style TargetType="Button">
    <Setter Property="Background" Value="Green"/>
    <Setter Property="Foreground" Value="Blue"/>
    <Setter Property="FontSize" Value="11"/>                          
</Style>
Style attribute is not specified with the control when using the implicit style

<Button  x:Name="GreenButton" Content="Green Button"/> 
In Explicit styling the style is specified as :-

<Style x:Key="ButtonStyle" TargetType="Button">
    <Setter Property="Background" Value="Green"/>
         <Setter Property="Foreground" Value="Blue"/>
    <Setter Property="FontSize" Value="11"/>                          
</Style>
To implement explicit styling the style attribute is specified

<Button x:Name=" GreenButton" Content="Green Button" Style="{StaticResource ButtonStyle}"/>
The implicit styling can be overwritten by specifying explicit style in the control.

In this post we will see how we can define explicit styles.

Create a folder that will contain xaml pages used for designing. Each page having explicit style defined for different controls.

Create a page CRM2011_ButtonStyle.xaml and specify the button style as specified below :

<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Style x:Key="CRM2011_ButtonStyle" TargetType="Button">
    <Setter Property="Background" Value="#FF1F3B53"/>
    <Setter Property="Foreground" Value="#FF000000"/>
    <Setter Property="Padding" Value="3"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="BorderBrush" Value="#FF666666" />
    <Setter Property="Height" Value="22" />
    <Setter Property="Width" Value="84" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Button">
          <Grid>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <ColorAnimation Duration="0" To="#FF336699" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" Storyboard.TargetName="Background"/>
                    <ColorAnimation Duration="0" To="#FFE2F1F9" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                    <ColorAnimation Duration="0" To="#FFC4E5F6" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                    <ColorAnimation Duration="0" To="#FF98D1EF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                    <ColorAnimation Duration="0" To="#FF6CB4DB" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <ColorAnimation Duration="0" To="#FF000000" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" Storyboard.TargetName="Background"/>
                    <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement"/>
                    <ColorAnimation Duration="0" To="#FFE2F1F9" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                    <ColorAnimation Duration="0" To="#FFC4E5F6" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                    <ColorAnimation Duration="0" To="#FF98D1EF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                    <ColorAnimation Duration="0" To="#FF6CB4DB" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimation Duration="0" To=".45" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Focused"/>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="Background" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="#FFD4D0C8">
              <Grid Background="{TemplateBinding Background}" Margin="1">
                <Border x:Name="BackgroundAnimation" Background="#FF448DCA"/>
                <Rectangle x:Name="BackgroundGradient">
                  <Rectangle.Fill>
                    <LinearGradientBrush StartPoint=".5,0" EndPoint=".5,1">
                      <GradientStop Color="#FFF2F2F2" Offset="0"/>
                      <GradientStop Color="#FFECECEC" Offset=".5"/>
                      <GradientStop Color="#FFDDDDDD" Offset=".5"/>
                      <GradientStop Color="#FFD3D3D3" Offset="1"/>
                    </LinearGradientBrush>
                  </Rectangle.Fill>
                </Rectangle>
                <Border BorderBrush="#FFFFFFFF" BorderThickness="0,1,0,0" />
              </Grid>
            </Border>
            <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
            <Rectangle x:Name="DisabledVisualElement" Fill="#FFFFFFFF" IsHitTestVisible="false" Opacity="0"/>
            <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Margin="1" Opacity="0" Stroke="#FF666666" StrokeThickness="1"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <!-- Resource dictionary entries should be defined here. -->
</ResourceDictionary>
Notice that the style is mentioned within a ResourceDictionary. Silverlight styles are implemented using a mechanism called ResourceDictionaries. ResourceDictionaries can be merged, so we can define styles in several places and merge them into a single dictionary. Unfortunately this is necessary for applying several style definitions to the same control.
Merging Resource Dictionary

<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <ResourceDictionary.MergedDictionaries>
      <ResourceDictionary Source="CRM2011_ButtonStyle.xaml"/>
        <ResourceDictionary Source="CRM2011_DataGridStyle.xaml"/>
        <ResourceDictionary Source="CRM2011_ScrollBarStyle.xaml"/>
        <ResourceDictionary Source="CRM2011_DataGridColumnHeaderStyle.xaml"/>
        <ResourceDictionary Source="CRM2011_DataGridCellStyle.xaml"/>
        <ResourceDictionary Source="CRM2011_DataGridRowStyle.xaml"/>        
    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
You can find a Silverlight application with CRM style Datagrid at http://www.devvblog.com/?p=58