Sunday, November 13, 2011

CRM2011 Setup/Upgrade Errors and Resolutions

This is the second part of my last blog Installing CRM2011 with Precreated AD Groups.
The following are some of the errors and their resolutions encountered during installation/upgrade

Error 1

SQLSERVERAGENT (SQLSERVERAGENT) service is not running on the server ......

clip_image002


Resolution:

· Check if SQLSERVERAGENT service is running
· Open the port 445 for SQL Server.



Error 2

During the import of the organizations the following warning was received.
"Fragmented indexes were detected in the Microsoft Dynamics CRM database",

Resolution:


Re-index the organisation databases
USE MyDatabase
GO
EXEC sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?', ' ', 80)"
GO
EXEC sp_updatestats
GO
Updating statistics ensures that queries compile with up-to-date statistics

Error 3

The following error message was received when testing the email router:
Type 'System.ServiceModel.Channels.ReceivedFault' in Assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable

Resolution:


Add the account running the email router services to PrivUserGroup security group.

Error 4

The following error message was received when accessing the reports from any of the organizations:
Microsoft.Crm.Web.Reporting.SrsReportViewer.SetExecutionCredentials(ServerReport reportObj) Cannot create a connection to data source 'MSCRM'. (rsErrorOpeningConnection)
The reason was SSRS connector(reporting extensions) was installed using user other than deployment account. The SSRS service account was missing in privreportinggroup group.

Resolution:


  • · Add SSRS service account to privreporting group.
  • · Reinstall the reporting extension again using deployment account.
The process to resolve was as follows:
  1. 1. Uninstall the Reporting Extensions.
  2. 2. Go to the CONFIG DB (MSCRM_CONFIG) of CRM and update your organization's row in the Organization table to set the AreReportsPublished boolean field to FALSE.
  3. 3. Re-install the Reporting Extensions and they should publish the reports again.
Note: You will see the message about installation is republishing the reports again

FIXES FOR THE UPGRADED ORGANISATIONS

The section contains information on the issues encountered that required fixing for the upgraded organisations.

Issue 1

Unknown labels in settings group as shown in the screen shot below. This had happened to all four organisations.
image clip_image006
             Before                              After



Resolution:

Follow the Microsoft article for resolution: http://support.microsoft.com/kb/2530358.


Issue 2

The main tab is closed by default as shown in the screen shot below:
image
It is noted that this happened on multiple different locations throughout all the organisations.


Resolution:

  • Open the form in customisation mode.
  • Expand the tab, save the changes and then publish the changes.
There were few other things that did not work after upgrade. One of them was, the client has custom button to “Create Phone Cal” on contact and account form. The button was using builtin javascript function “locAddActTo(4210)”. I need to change the ribbon and javascript to fix that that function does not exist in CRM 2011.

clip_image002[9]
That’s all from me.

Saturday, November 5, 2011

Installing CRM2011 with precreated AD Groups

Last few weeks, I was working on CRM4.0 to CRM2011 upgrade.  I am doing few blogs to share my experience.  My upgrade involved moving the CRM sever and SQL server to a new severs. SSRS server was installed on the same as new SQL Server.  
I am not doing a step by step installation in this blog. I will be discussing the useful tips and solutions to some of the errors/problems I encounter.  Here are the main steps
1.    Install the CRM2011
2.    Install reporting extension(SSRS Connector) and Report Authoring Extension(Bids extensions)
3.    Backup 4.0 organization databases and restore them on  new SQL Server
4.    Import the organizations into CRM2011 using deployment manager
5.    Install/configure Email router
6.    Testing and fixing the issues.

The installation involved deploying the CRM Server on procreated AD groups.

Install the CRM2011

Installation Account Permissions

The user who is installing Microsoft Dynamics CRM should be a part of Local Administrator group on Microsoft Dynamics CRM server and on SQL Server. For more detail have a look at http://support.microsoft.com/kb/946677
Important
The deployment user should also have sysadmin permission on the SQL Server Instance to import the organization (otherwise you will get error message)

Create the AD Groups

Create the following security groups in Active Directory:
•    PrivUserGroup
•    PrivReportingGroup
•    ReportingGroup
•    SQLAccessGroup

Important•    You don’t need to create UserGroup for CRM2011.
•    Use naming conventions for creating the groups for e.g.  OrgEnvironmentNameOfTheGroup (ABCDevPrivUserGroup).
•    Need to know more about permissions on these group, click here http://support.microsoft.com/kb/946677

Create configuration xml file for precreated groups

Here is sample of the config file

<CRMSetup>
   <Server>
        <Groups AutoGroupManagementOff="true">
               <PrivUserGroup>CN=PrivUserGroup,OU=Company Name,OU=Company Name,DC=<domain>,DC=<domain_extension></PrivUserGroup>
             <SQLAccessGroup>CN=SQLAccessGroup,OU=Company Name,OU=Company Name, DC=<domain>,DC=<domain_extension></SQLAccessGroup>
                    <ReportingGroup>CN=ReportingGroup,OU=Company Name,OU=Company Name, DC=<domain>,DC=<domain_extension></ReportingGroup>
    <PrivReportingGroup>CN=PrivReportingGroup,OU=Company Name,OU=Company Name, DC=<domain>,DC=<domain_extension></PrivReportingGroup>
     </Groups>
    </Server>
</CRMSetup>

Now you need to change highlighted parts of the file to suit your system. If you like to know more about the structure chek the Microsoft article mentioned above in the post.

The easiest way to get the proper CN,OUs,DCs without making any mistakes use the dsquery command. Open the command prompt and Run
            dsquery group -name adgroupprefix* Change adgroupprefix with starting characters of your group
For e.g dsquery group -name ABCDev*

image

It will display all the information you need to fill the config file.
Just copy that and replace highlighted area in the config file above.
Save the file as config.xml.

Run CRM2011 Install

  • Open the cmd prompt and navigate the crm media  to folder containing ServerSetup.exe.
  • Run ServerSetup.exe /config C:\config.xml
  • Follow the installation wizard instructions.

Install reporting extension (SSRS Connector) and Report Authoring Extension (Bids extensions)


Reporting extension (SSRS Connector)

The deployment needs local administrator permissions to install reporting extension (SSRS Connector). The installation adds the Microsoft SQL Server Reporting Services “service account” for the associated instance of SQL Server to the PrivReportingGroup security group.
Important Reporting extensions must be installed to publish the reports and to import the organization.

Report Authoring Extension

(Bids extensions) is required to write fetchxml based reports.

Second part is coming soon........

Sunday, October 16, 2011

How to trigger "onchange" event for the fields in locked section

There is  "Scheduling Information" section on  Appointment and Service Activity entity forms.
You can not  change the properties of the fields in this section. You cannot add javascript to "OnChange" events of these fields. If you double click on any of the field in this section, you will get a message "You can not modify the properties of this element because it is with in a locked section"
















So how can you add javascript to onchange event on these fields? It is simple and here is what I did to achieve this.
  • Add a new tab to the form.
  • In the visibility section of tab unctick the "Visible by default" checkbox .


























  • In the field explore window untick "Only shows unused fields". It will display all the available entity  fields in the list.
  • Add the fields to this newly created tab. ( Fields that are also present on the locked section)
  • Add the "On Change" event to one of the field.
  • Save the changes and publish the entity.
  • Now if you change the value of field in the locked section, it will trigger the event you defined in the newly created tab's field.

Wednesday, October 5, 2011

CRM2011 User Settings Utility 2.0

Here I am with User Settings Utility 2.0. I have added some more features to version 1.0.

Here is a complete list of new features.
  1. Ability to filter users based on  Business Unit names.
  2. Ability to set the email options
    • Allow other users to send emails on user's behalf
    • Track Email Messages
    • Create Records from tracked email
  3. Ability to add/remove Startup Pane
  4. Ability to open the advance find in simple or detailed mode
  5. Ability to set Error Notification Preference
Here is link to download the solution from codeplex.

Screen Shot


Good Luck.



Sunday, September 18, 2011

How to create an email activity using REST Endpoints in CRM2011


How tough it can be to create an activity using code? It sounds very easy but there are few issues, if you are using REST Endpoints.

REST Endpoints do not support all the CRM data types. One of those data type is PartyList. PartyList is very important to create most of the activity like emails, appointments, phone calls etc.

To set the value of the PartyList field you need an array of PartyLists as you can have more than value for those fields. For e.g you can have more than one recipient for an email or you can have more than resource for an appointment.

As I mentioned earlier, REST Endpoints do not support PartyList, So its is impossible to assign value to these fields. If you look at DataSet returned by the Rest Endpoints, It looks like they are treating PartyList fields like string fields.

image

These values does not even return the guid or name of the PartyList entity. if you look at sender field in the screen shot above, it does not have guid or the name of the system user who sent this email.
I tried the same using following code:

email.Sender="crm2011@emailops.com.au";
var partlistcollection = new Array(); //tried to create an array of PartyLists

partlistcollection[0] = {Id: "8384E684-7686-E011-8AF0-00155D32042E",LogicalName: "contact",Name: "Amreek Singh"};
email.ToRecipients=JSON.stringify(partlistcollection);

But it did not work, if you pass a string value to the PartyList fields, You won’t get any error message but you won’t see any value in those fields on a created entity. 

Now here is the solution. You need to create an activity (in this case it’s  an email) first and then create a PartyList entity and link it back to the created activity.

function CreateEmail() {
alert("CreateEmail Begin");

var email = new Object();
email.Subject = "Sample Email Using REST";
SDK.JScriptRESTDataOperations.Create(email, "Email", EmailCallBack, function (error) { alert(error.message); });
}

// Email Call Back function
function EmailCallBack(result)
{
var activityParty=new Object();
// Set the "party" of the ActivityParty // EntityReference of an entity this activityparty relatated to. 
activityParty.PartyId = {
  Id: "8384E684-7686-E011-8AF0-00155D32042E",//replace this with the contactid from your system.
  LogicalName: "contact"
};
// Set the "activity" of the ActivityParty
// EntityReference.
activityParty.ActivityId = {
  Id: result.ActivityId, 
  LogicalName: "email"
};
// Set the participation type (what role the party has on the activity).
activityParty.ParticipationTypeMask = { Value: 2 }; // 2 mean ToRecipients
SDK.JScriptRESTDataOperations.Create(activityParty, "ActivityParty",ActivityPartyCallBack , function (error) { alert(error.message); });
}

function ActivityPartyCallBack(reuslt)
{
alert("Process Completed");
}

activityParty.ParticipationTypeMask = { Value: 2 }; is very important as it will specify if this PartList is sender/recipient/resource etc  of the activity.

Here is the link to complete list of activityParty.ParticipationTypeMask click here.
For this sample, I have used the generic REST CRUD data operations library created by Jim Daly.
Add references to following Java Script  web resources to try the solution.
  • SDK.JScriptRESTDataOperations
  • JSON2
Here is the link to unmanaged solution RESTEmailSolution_1_0
  • I hope this helps.

Tuesday, September 6, 2011

How to change the maximum no. of controls on CRM2011 Dashboards

The maximum number of controls allowed on CRM2011 dashboards are 6. You cannot put the more than 6 graphs/charts/iframes/webresources etc. on the dashboard.
This setting is applied to the server not a organisation setting. So you cannot change this setting for CRM Online but you can change this for an on-premise installation.
There are two ways to do it.
  1. Using Deployment Web Service (http://myservername/xrmdeployment/2011/deployment.svc)
  2. Using Window Power Shell
Windows Power Shell Option is the easiest one.
  • Open the Windows Power Shell
  • Add the Microsoft Dynamics CRM PowerShell snap-in using
Add-PSSnapin Microsoft.Crm.PowerShell
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 okay.
  • Run the following 3 command
$setting = Get-CrmSetting -SettingType DashboardSettings
$setting.MaximumControlsLimit = 7 (// you can change this number)
Set-CrmSetting -Setting $setting
Here is my screen shot with 7 charts.
    Charts

Monday, August 29, 2011

CRM2011 User Settings Utility

Hi Guys, I have created this CRM2011 utility tool that will help administrators to update personal settings of multiple users with  just few clicks. This is also my first codeplex project. Here is the link http://crm2011usersettings.codeplex.com.
Please leave feedback and suggestions.
Utility



Thanks