Monday, 30 March 2015

The word breaker for language 1033 is not installed

Today, when I was installing MS CRM 2011 on the server I got the below error at Microsoft SQL Server

The word breaker for language 1033 is not installed




 
The solution is simple.

Go back to your SQL Setup file and select new features to SQL Server and select Full text and Semantic Extractions for Search




Even after installing you will get a warning saying

The Word breaker for language -1 is not installed

Just Restart the server machine after you install "Full-text Search" component and then start CRM 2011 installation all over again and the you will notice the Warning is gone.
 --
Happy CRM'ing
Gopinath

Thursday, 26 March 2015

Refresh SubGrid from JavaScript in CRM 2011, 2013 and 2015

We can refresh the subgrid on the form using JavaScript. Can use the same code on ribbon button click or onchange or wherever depending on the requirement.
 
Xrm.Page.ui.controls.get("SubGridName").refresh();

Here is the way to get the name of the subgrid.




--
Happy CRM'img
Gopinath.

Wednesday, 25 March 2015

MS CRM 2011 to 2015 Upgrade Process

MS CRM 2011 to 2015 upgrade using a new SQL Server Instance

We recommend this option for upgrading from Microsoft Dynamics CRM CRM 2011(On-Premise) to Microsoft Dynamics CRM 2015. Although this option requires a different servers for Microsoft Dynamics CRM 2015 Server and a different instance of SQL Server, it provides the least amount of potential downtime for Microsoft Dynamics CRM users because the Microsoft Dynamics CRM  2011(On-Premise) deployment can remain functioning until the upgrade is completed and verified.
The following diagram illustrates the high-level overview of the process required to upgrade a Microsoft Dynamics CRM 2011 implementation to Microsoft Dynamics CRM 2015.

This process would be performed in the development environment and in principle in other environments (test, pre-production, and production), while in the latter you would likely combine with the change management process to deploy refactored customization and code.
 
1.    Create a brand new CRM 2013 environment. Since the CRM 2013 deployment is only temporary, the CRM 2013 deployment can be created as a virtual machine. CRM 2013 trial product key can be used, as this is a temporary setup.
2.    Create a brand new CRM 2015 Deployment.
3.    Take the Microsoft Dynamics CRM 2011 production deployment offline
4.    Export the organization database backup from the CRM 2011 environment.
5.    Restore the database in the CRM 2013 environment, using the sql server utility.
6.    Import the organization on the CRM 2013 using the deployment manager.
7.    Verify the upgraded CRM 2013 organization.
8.    Export the organization database backup from the CRM 2013 environment.
9.    Restore the database in the CRM 2015 environment, using the sql server utility.
10. Import the organization on the CRM 2015 using the deployment manager.
11.  Verify the upgraded CRM 2015 organization.
12.  Import the solutions with refactored code.
13. Perform validation to ensure the system is working as expected.

--
Happy CRM'img
Gopinath

Tuesday, 24 March 2015

How to know your Resource Usage in CRM 2015 Online

In CRM 2015, we can check the CRM Resource Usage

Settings--Administration--Resources in Use


--
Happy CRM'ing
Gopinath

Monday, 23 March 2015

Assign a record to user in CRM 2011, 2013 and 2015

Here is the code for assigning a record to other user.

AssignRequest assign = new AssignRequest
{
     //systemuser; i.e., User to whome you are assigning the entity to
     Assignee = new EntityReference("systemuser", guidUserId),
     //Current record which you are assigning to the user
     Target = new EntityReference("account", guidAccount)
};
// Execute the Request
service.Execute(assign);


--
Happy CRM'ing
Gopinath.

Send email using Email Template CRM 2011, 2013 and 2015

Here is the code for sending an email via template using C# code

SendEmailFromTemplateRequest emailUsingTemplateReq = new SendEmailFromTemplateRequest
{
      Target = entEmail,
      // Template ID
      TemplateId = entEmailTemplate.Id,
      // The regarding Id is required, and must be of the same type as the Email Template.
      RegardingId = erfRecord.Id,
      RegardingType = Constants.OPPORTUNITY
};

// SendEmailFromTemplateRequest creates one more email for sending. So deleting the email created initially.
service.Delete(Constants.EMAIL, entEmail.Id);

--
Happy CRM'ing
Gopinath

Friday, 20 March 2015

Print Selected content on HTML Page

Here is the code for printing selected content on HTML Page.

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
    <script type="text/javascript" language="javascript">
        function PrintDivContent() {
            var divContents = document.getElementById("dvContainer").innerHTML;
            var printWindow = window.open('', '', 'height=400,width=800');
            printWindow.document.write('<html><head><title>DIV Contents</title>');
            printWindow.document.write('</head><body >');
            printWindow.document.write(divContents);
            printWindow.document.write('</body></html>');
            printWindow.document.close();
            printWindow.print();
        }
     </script>
</head>
<body>
    <div id="dvContainer">
        This content needs to be printed.
    </div>
    <input type="button" value="Print Div Contents" id="btnPrint" onclick="PrintDivContent();" />
</body>
</html>

--
Happy Coding
Gopinath

Thursday, 19 March 2015

Show logged in or current Username in Report CRM 2011, 2013 and 2015

It is always good to show to user name who is running the report on it.

We can achieve it by creating one more dataset exclusively for getting username from CRM. You use this dataset to display fullname in the report.

SQL Report

select fullname
from FilteredSystemUser
where systemuserid = dbo.fn_FindUserGuid()
 

Fetch XML Report


<fetch version="1.0" output-format="xml-platform"

       mapping="logical" distinct="false">

   <entity name="systemuser">

      <attribute name="fullname" />
      <attribute name="systemuserid" />
      <order attribute="fullname" descending="false" />
      <filter type="and">
         <condition attribute="systemuserid"
                    operator="eq-userid" />
      </filter>
   </entity>
</fetch>
 
 
--

Happy CRM'img
Gopinath

Wednesday, 18 March 2015

Get Workflow ID and Execute it in CRM 2011, 2013 and 2015 using C# Code

Here is the code for retrieving workflow id by name and issue execute request on it.

QueryExpression objQueryExpression = new QueryExpression("workflow");
objQueryExpression.ColumnSet = new ColumnSet(true);
objQueryExpression.Criteria.AddCondition(new ConditionExpression("name", ConditionOperator.Equal, "<WorkflowName>"));
objQueryExpression.Criteria.AddCondition(new ConditionExpression("parentworkflowid", ConditionOperator.Null));
EntityCollection entColWorkflows = service.RetrieveMultiple(objQueryExpression);
if (entColWorkflows != null && entColWorkflows.Entities.Count > 0)
{
       ExecuteWorkflowRequest request = new ExecuteWorkflowRequest()
       {
            WorkflowId = entColWorkflows.Entities[0].Id,
            EntityId = guidRecord
       };
       // Execute the workflow.
       ExecuteWorkflowResponse response = (ExecuteWorkflowResponse)service.Execute(request);
}

--
Happy CRM'img
Gopinath.
 

Tuesday, 17 March 2015

Trigger a Plugin on Adding User or Removing User from Access Team in CRM 2013/2015

We can trigger a plugin on add/remove user from Access Team in CRM 2013 and 2015

SDK provided two messages for it
  1. AddUserToRecordTeam
  2. RemoveUserFromRecordTeam

AddUserToRecordTeam



You will get input parameters as follows

Record -- Entity Reference object of the record
SystemUserId -- User which you want to remove
TeamTeamplateId -- Access Team Template Guid

For more information on input parameters check - AddUserToRecordTeamRequest Members

RemoveUserFromRecordTeam

 

You will get input parameters as follows Check
  
Record -- Entity Reference object of the record
SystemUserId -- User which you want to remove
TeamTeamplateId -- Access Team Template Guid
For more information on input parameters check - RemoveUserFromRecordTeamRequest Members

For more information on how to Add/Remove user from Access Team, please refer the following links.

Add User to Access Team
Remove User from Access Team

--
Happy CRM'ing
Gopinath.

 

Monday, 16 March 2015

Remove user from Access Team in CRM 2013 and 2015

Hello,

Here is the C# code to remove the user from the access team.

RemoveUserFromRecordTeamRequest objRemoveUser = new RemoveUserFromRecordTeamRequest();
objRemoveUser.Record = entRecord;
objRemoveUser.SystemUserId = guidSystemUserId;
objRemoveUser.TeamTemplateId = guidTeamTeplateId;
RemoveUserFromRecordTeamResponse response = RemoveUserFromRecordTeamResponse)service.Execute(objRemoveUser);

Record -- Entity Reference object of the record
SystemUserId -- User which you want to remove
TeamTeamplateId -- Access Team Template Guid

Here is the code to get the template guid from template name.


public Guid GetTemplateIDByName(IOrganizationService objService, string strTemplateName)
{
      Guid guidTeamTeplateId = new Guid();
      //  Query using ConditionExpression and FilterExpression
      ConditionExpression condition = new ConditionExpression();
      //attribute name add to condition
      condition.AttributeName = "teamtemplatename";
      //operator add to condition
      condition.Operator = ConditionOperator.Equal;
      //values added to condition
      condition.Values.Add(strTemplateName);
      // filter creation
      FilterExpression filter = new FilterExpression();
      //condition added
      filter.Conditions.Add(condition);
      //create query expression
      QueryExpression query = new QueryExpression("teamtemplate");
      //filter added to query
      query.Criteria.AddFilter(filter);
      //retrieve all columns
      query.ColumnSet = new ColumnSet("teamtemplatename");
      // execute query which will retrieve the Access team teamplate
      EntityCollection accessTeamColl = objService.RetrieveMultiple(query);
      if (accessTeamColl != null && accessTeamColl.Entities.Count > 0)
      {
          guidTeamTeplateId = accessTeamColl.Entities[0].Id;
      }
      return guidTeamTeplateId;
}

Add user from Access Team CRM 2013 and 2015


--
Happy CRM'ing
Gopinath

 

Add user to Access Team CRM 2013 and 2015

Hello,

Here is the C# code to add the user from the access team.

// Add Account User to Access Team
AddUserToRecordTeamRequest teamAddRequest = new AddUserToRecordTeamRequest();
teamAddRequest.Record = erfRecord;
teamAddRequest.SystemUserId = guidSystemUserId;
teamAddRequest.TeamTemplateId = guidTeamTeplateId;
AddUserToRecordTeamResponse response = (AddUserToRecordTeamResponse)service.Execute(teamAddRequest);

Record -- Entity Reference object of the record
SystemUserId -- User which you want to remove
TeamTeamplateId -- Access Team Template Guid

Here is the code to get the template guid from template name.


public Guid GetTemplateIDByName(IOrganizationService objService, string strTemplateName)
{
      Guid guidTeamTeplateId = new Guid();
      //  Query using ConditionExpression and FilterExpression
      ConditionExpression condition = new ConditionExpression();
      //attribute name add to condition
      condition.AttributeName = "teamtemplatename";
      //operator add to condition
      condition.Operator = ConditionOperator.Equal;
      //values added to condition
      condition.Values.Add(strTemplateName);
      // filter creation
      FilterExpression filter = new FilterExpression();
      //condition added
      filter.Conditions.Add(condition);
      //create query expression
      QueryExpression query = new QueryExpression("teamtemplate");
      //filter added to query
      query.Criteria.AddFilter(filter);
      //retrieve all columns
      query.ColumnSet = new ColumnSet("teamtemplatename");
      // execute query which will retrieve the Access team teamplate
      EntityCollection accessTeamColl = objService.RetrieveMultiple(query);
      if (accessTeamColl != null && accessTeamColl.Entities.Count > 0)
      {
          guidTeamTeplateId = accessTeamColl.Entities[0].Id;
      }
      return guidTeamTeplateId;
}

Remove user from Access Team in CRM 2013 and 2015

--
Happy CRM'ing
Gopinath