How to change the DashboardSettings of maximum controls limit in Dynamics CRM2011/2013

The maximum number of controls allowed on CRM2011 or CRM 2013 dashboards is 6. You cannot put the more than 6 graphs/charts/iframes/web resources etc. on the dashboard.

We can extend the number of controls as per the user needs. This setting is applied to the server not a organization setting. So you cannot change this setting for CRM Online but you can change this for an on-premise installation.

Option 1: Using Window Power Shell we can achieve it.

  1. Open the Windows Power Shell command window
  2. Add the Microsoft Dynamics CRM PowerShell snap-in using

Add-PSSnapin Microsoft.Crm.PowerShell
Sometimes You may get the message saying something like “Add-PSSnapin : Cannot add Windows PowerShell snap-in Microsoft.Crm.PowerShell because it is already added.” It is fine no problem.

3.  Run the following 3 commands

$setting = Get-CrmSetting -SettingType DashboardSettings

$setting.MaximumControlsLimit = 10

Set-CrmSetting -Setting $setting

After that open CRM, still you will be see only 6 components on the dashboard design, however you can add extra components based on how much you have set the limit.

Once you crossed the limit you will get following error message.

DashboardSettings

Option 2: If Powershell does not work, use following C# code to do the same

  public static void UpdateDashboardSettings()
        {
            //Create Instance of Deployment Service
            DeploymentServiceClient service = Microsoft.Xrm.Sdk.Deployment.Proxy.ProxyClientHelper.CreateClient(new Uri("http://CRMServer/Organization/XRMDeployment/2011/Deployment.svc"));
            //Use Default network Credentials(User should de Deployment Admin in Deployment Manager and System Admin in CRM)
            service.ClientCredentials.Windows.ClientCredential = (NetworkCredential)CredentialCache.DefaultCredentials;

            //Retrieve Current Dashboard Settings MaximumControlsLimit
            Microsoft.Xrm.Sdk.Deployment.RetrieveRequest retrieveReq = new Microsoft.Xrm.Sdk.Deployment.RetrieveRequest();
            retrieveReq.EntityType = DeploymentEntityType.DashboardSettings;

            Microsoft.Xrm.Sdk.Deployment.RetrieveResponse retrieveRes = (Microsoft.Xrm.Sdk.Deployment.RetrieveResponse)service.Execute(retrieveReq);
            if (retrieveRes != null && retrieveRes.Entity != null)
            {
                DashboardSettings dsCurrentResult = (DashboardSettings)retrieveRes.Entity;
                if (dsCurrentResult != null)
                    Console.WriteLine("Current DashboardSettings MaximumControlsLimit is " + dsCurrentResult.MaximumControlsLimit);
            }
            //Update Current Dashboard Settings MaximumControlsLimit = 10
            Microsoft.Xrm.Sdk.Deployment.UpdateRequest updateReq = new Microsoft.Xrm.Sdk.Deployment.UpdateRequest();
            DashboardSettings ds = new DashboardSettings();
            ds.MaximumControlsLimit = 10;
            updateReq.Entity = ds;
            Microsoft.Xrm.Sdk.Deployment.UpdateResponse updateRes = (Microsoft.Xrm.Sdk.Deployment.UpdateResponse)service.Execute(updateReq);

            //Retrieve again after updating Current Dashboard Settings MaximumControlsLimit
            Microsoft.Xrm.Sdk.Deployment.RetrieveRequest retrieveReq1 = new Microsoft.Xrm.Sdk.Deployment.RetrieveRequest();
            retrieveReq1.EntityType = DeploymentEntityType.DashboardSettings;
            Microsoft.Xrm.Sdk.Deployment.RetrieveResponse retrieveRes1 = (Microsoft.Xrm.Sdk.Deployment.RetrieveResponse)service.Execute(retrieveReq1);

            if (retrieveRes1 != null && retrieveRes1.Entity != null)
            {
                DashboardSettings dsUpdatedResult = (DashboardSettings)retrieveRes1.Entity;
                if (dsUpdatedResult != null)
                    Console.WriteLine("After Updating DashboardSettings MaximumControlsLimit is " + dsUpdatedResult.MaximumControlsLimit);

            }
        }

NOTE: You need add microsoft.xrm.sdk.deployment DLL from SDK to access those Deployment classes and methods. User who is running this should be Deployment Admin in Deployment Manager and Sys Admin in CRM

Incase if you are getting 404 error while accessing Deployment service, you need to check your CRM web server IIS settings and make sure XRMDeployment is not configured in Hidden Segments in IIS, Follow below steps to remove/add XRMDeployment setting in IIS

  1. Open Internet Information Services(IIS) Manager
  2. Expand Server on left navigation
  3. Expand Sites on the Left Navigation
  4. Click on Microsoft Dynamics CRM
  5. Click on “Request Filtering” icon in IIS on right side window
  6. Click on “Hidden Segments” tab on Request Filtering window on right side
  7. If “XRMDeployment” exists then select “XRMDeployment” and right click on “Remove” and say “Yes” to remove “XRMDeployment” from Hidden Segments
  8. Once you are done executing PowerShell, SDK Code you can add using “Add Hidden Segment” option, enter “XRMDeployment” in Hidden Segment window and click on “OK” to close the window.
Advertisements

Configure Bing maps in Dynamics CRM 2013

Microsoft Dynamics CRM 2013 now comes with an out of the box integration with Bing Maps. This integration uses the address record of your account, lead, contact or custom entity to enable that location and render a Bing Map right on the CRM 2013 page. These maps have the typical Bing Maps functionality: you can see nearby landmarks, “grab” a map and move it around, and you can use your mouse’s scroll wheel to zoom in or out. Move your cursor over the location dot to display the address in a pop-up, and click on the map to get directions.

Bing Maps can be displayed in forms for the account, contact and lead forms. You can remove the Bing Maps area in the form editor or add it back by using the Bing Maps button on the Insert tab of the form editor.

To enable Bing Maps the system setting ‘Show Bing Maps on forms’ must be enabled.

  1. Click on Dynamics CRM-> Settings tile
  2. Click on Settings-> Administration tile
  3. Click on System Settings icon
  4. Set ‘Yes’ to  ‘Enable Bing maps’->‘Show Bing Maps on forms’  in   ‘General’ tab

Bing Maps1
Microsoft Dynamics CRM 2013 on-premise organizations will need to enter a Bing Maps Key and enter it in the system setting Please enter Bing Maps key. Obtain a Bing Map key from: https://www.bingmapsportal.com. Microsoft Dynamics CRM Online subscribers do not require a key.
How to add Bing maps:  Below screenshots shows how to add Bing Maps to Account entity main form

  1. Go to Account entity customizations and click on Account main form
  2. Click on ‘Bing Maps’ from INSERT tab

Bing Maps2
Bing Maps3
After you set Bing maps on Account form, you can see maps like below:
BingMaps4
Following table explains what are the properties  we can set on Bing Maps

Tab Property Description
General Label Required: A label to display for the Bing Maps.
Display label on the form Whether the label should be displayed.
Select an address to use with the Bing Maps control Choose which address should be used to provide data for the map.
Visible by default Showing the Bing maps is optional and can be controlled using scripts. More information: Visibility options
Formatting Select the number of columns the control occupies When the section containing the Bing Maps has more than one column you can set the field to occupy up to the number of columns that the section has.
Select the number of rows the control occupies You can control the height of the Bing Maps by specifying a number of rows.
Automatically expand to use available space You can allow the Bing Maps height to expand to available space.

Disable auto save functionality in Dynamics CRM 2013

In Microsoft Dynamics CRM 2013, you no longer need to click or tap Save when you’re editing. It has the ability to save records automatically when you create new record or update existing record. While editing a record, CRM automatically saves the record every 30 seconds and when you close the record or go to other page, it gets automatically saved. By default, the system automatically saves any edited records every 30 seconds, or when you navigate to another record.

Sometimes it might cause performance issues, If you have plug-ins, workflows, or form scripts that execute when a record is saved, they’ll run each time auto-save occurs. This might lead to undesirable behaviors if these extensions weren’t designed to work with auto-save.

This feature can also be disabled at organization level in the System Settings, if anyone is not interested to use.

  1. Click on Dynamics CRM-> Settings tile
  2. Click on Settings-> Administration tile
  3. Click on System Settings icon
  4. Set “No” to “Enable auto save on all forms” under “Select the default save option for forms”

Note: Since it is organization level settings, once you set “No” auto save will not work on any entity. There is no option to disable autosave at the entity or form level, but a small script can be added to the OnSave event of a form that will disable it on the form level. Check out below how to do this.

AutoSave1

Configure the OnSave event:

  1. Write following JavaScript code in your entity JavaScript file.
  2. function preventAutoSave(econtext) {
        var eventArgs = econtext.getEventArgs();
        if (eventArgs.getSaveMode() == 70) {
            eventArgs.preventDefault();
        }
    }
    
  3. In the Form Properties window, in the Event Handlers section, set Event to OnSave.
  4. Click on Add  and choose the above code written JavaScript resource file
  5. In the Handler Properties window, set Library to the web resource you added in the previous step.
  6. Type ‘preventAutoSave’ in the Function field. This is case sensitive. Do not include quotation marks.
  7. Make sure that Enabled is checked.
  8. Check Pass execution context as first parameter.
  9. Click OK to close the Handler Properties dialog.
  10. The Handler Properties dialog should look like this.

AutoSave2

After you apply this script to the OnSave event, when people edit a record using this form the message unsaved changes will appear in the bottom right corner of the form just as it would if auto-save was not disabled. But this message will not go away until people click the Save button next to it.

The Sender, or one or more recipients, could not be resolved to a record in Dynamics CRM 2011

You may see some of the email activities are not processed in your workflow jobs, if you open any of email activity which contains invalid email addresses; you will see this error message “The Sender, or one or more recipients, could not be resolved to a record in Microsoft Dynamics CRM.”

Email

Solution 1:

You need to create a valid Account/ Contact/ Lead/ Queue/ User or Facility/Equipment record with email address mentioned in E-mail activity.

You can set this to create a Contact/Lead automatically, if Sender Email Id is not recognized by CRM

Step 1: Log on to CRM 2011 with administrative account (i.e. the account that was used to install CRM 2011 and CRM 2011 email router)

Step 2: go to File -> Options, this should open up Set Personal option page

E-mail Options

Solution 2:

If your CRM server to send emails to email addresses which does not belong to any of CRM records this issue could be resolved. You can check this setting as mentioned below.

If you are the system administrator, navigate to Settings -> System -> Administration and click on System Settings and then select E-mail tab and go to section “Set E-mail form options” and allow messages with unresolved e-mail recipients to be sent.

Email_Settings

The duration of the appointment is invalid in Dynamics CRM 2011

When user is creating an appointment with more than duration specified in System Settings, user will get a warning message “The duration of the appointment is invalid”, In this case I would suggest decreasing the appointment duration or asking your CRM administrator to increase appointment duration in system settings.
Default maximum duration in CRM 2011 is 10 days, unless your CRM administrator changed to something else.

Appmnt_Duration

If you are the system administrator, navigate to Settings -> System -> Administration and click on System Settings. You can set the ‘Maximum durations of an appointment in days’ in the Calendar tab under ‘Set scheduling options’ shown below.

Appmnt_Duration_Settings

Attachment blocked in Dynamics CRM 2011

We have discussed earlier in one of the post was on Attachment file size limitations in CRM 2011

In this post I am discussing about ‘Manage Attachment file types in CRM 2011’
Users can attach any file to any record in Dynamics CRM 2011, except that file type is blocked in CRM 2011, when you try to attach a file, if that file type is blocked in CRM 2011, it gives an exception message “The attachment is not a valid file type”.
In the below example I am trying to attach an app.config file which is actually blocked in CRM 2011.

AttachmentBlocked1

If you are the system administrator, navigate to Settings –> Administration and click on System Settings. You can set the file types to block in the General tab under ‘Set blocked file extensions for attachments’ shown below.

AttachmentBlocked2

Web Resource size limit or Attachment File size limit problem in Dynamics CRM 2011

Problem1: If you try to add any of the following web resource which exceeds more than 5 mb, you will get this error (Web Resource content size is too big).

File Extension type
Webpage (HTML) .htm, .html
Style Sheet(CSS) .css
Script(JSCript) .js
Data(XML) .xml
Image(PNG) .png
Image(JPG) .jpg
Image(GIF) .gif
Image(ICO) .ico
Silverlight(XAP) .xap
StyleSheet(XSL) .xsl, .xslt

Web Resource Limit

Problem2: If you try to add any attachment file to any record in CRM which exceeds more than 5 mb, you will get this error (The attachment is too large. The maximum file size is allowed is 5120 kilobytes)

Attachment Limit

Solution: Open System Settings in the CRM application from the following path in Dynamics CRM 2011 Settings–>Administration–>System Settings

Click on ‘E-mail’ tab of the ‘System Settings’ in the application. This setting limits the size of files that can be attached to email messages, notes, and web resources. The default setting is 5 MB. Change this limit to more than your web resource file size or attachment file size.

Settings