Update Rollup 1 for Microsoft Dynamics CRM 2013 Service Pack 1 has been released

The Microsoft Dynamics CRM 2013 Update Rollup 1 for Microsoft Dynamics CRM 2013 Service Pack 1 (SP1) is available on the download center.
UR 1 for Microsoft Dynamics CRM 2013 Service Pack 1 (SP1):
http://www.microsoft.com/en-us/download/details.aspx?id=44262.

Information on Update Rollup 1 for Microsoft Dynamics CRM 2013 Service Pack 1 (SP1)

The KB is located at http://support2.microsoft.com/kb/2953252.

Posted in MS CRM 2013 | Tagged , | Leave a comment

Data encryption in Microsoft Dynamics CRM 2013

I was trying to add an email for the User account on one of the imported organization and getting the error seen below.

Encryption Error 1

Encryption Error

I tried to resolve this and found information on this.
Microsoft Dynamics CRM 2013 uses standard SQL Server cell level encryption for a set of default entity attributes that contain sensitive information, such as user names and email passwords.
Microsoft Dynamics CRM users who have the system administrator security role can activate data encryption or change the encryption key after data encryption is enabled in the Settings -> Data Management -> Data Encryption area.

Encryption Error 2Encryption Error 3Encryption Error 4Once I have activated the encryption key everything is working perfectly.

Posted in MS CRM 2013 | Tagged , | Leave a comment

How to Change the ReportServer Url for Microsoft Dynamics CRM 2013 / 2011

Below are the steps to modify the Report Server URL and SQL Server for an Organization in Microsoft Dynamics CRM 2013 / 2011. This assumes that the report server is already installed and configured.
1. Open CRM Dynamics Deployment Manager
2. Select the Organization
3. Right Click and Disable the Organization.

Disable Organization

Disable Organization

4. Right Click again and Click on “Edit Organization”

Edit Organization

Edit Organization

5. Modify the URL of the SQL Server and Reporting Services URL and respond to the Wizard.

Deployment Wizard

Deployment Wizard

6. Enable the Organization.

Posted in MS CRM 2011, MS CRM 2013 | Tagged , , | Leave a comment

Update Rollup 2 for Microsoft Dynamics CRM 2013 has been released

The Microsoft Dynamics CRM 2013 Update Rollup 2 is now available on the download center.

UR 2:  http://www.microsoft.com/en-us/download/details.aspx?id=42272.

Information on CRM 2013 Update Rollup 2

Posted in MS CRM 2013 | Tagged , | Leave a comment

How to call Web Service from HTML page using Jquery

Below are the steps to call web service from html page using jquery
1. Create a Web Service with marked as ScriptService
[System.Web.Script.Services.ScriptService]
public class TestService : System.Web.Services.WebService
{
This will allow the Web Service to be called from script, using ASP.NET AJAX.
2. Create a method with marked as WebMethod and ScriptMethod for enabling client access.
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public string CreateAccount(RequestData objRequestData)
{
Since I am using the JSON as the data type I am marking the Response format as JSON.

Web Service Example
[System.Web.Script.Services.ScriptService]
public class TestService : System.Web.Services.WebService
{
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public string CreateAccount(RequestData objRequestData)
{
return objRequestData.Name;
}
}
Call Web Service from HTML Page
To call web service from HTML page $.ajax is used.The data send should be as object “objRequestData “. This is very important otherwise it wont work.

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="jquery-1.7.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
        });
        var GetJson = function () {
            var requestdata = {};
            requestdata.Name = "Amar Prakash";
            var pdata = { "objRequestData": requestdata };

            $.ajax({
                type: "POST",
                data: JSON.stringify(pdata),
                url: "http://localhost:54016/TestService.asmx/CreateAccount",
                contentType: "application/json;charset=utf-8",
                dataType: "json",
                success: function (data) {
                    alert(data.d);
                },
                error: function (xhr) {
                    alert(xhr.responseText);
                }
            });
        }

    </script>
</head>
<body>
    <br />
    <input type="button" id="jsonButton" onclick="GetJson()" value="Bind JSON" />
    <br />
    <br />
    <div id="jsonData">
    </div>
</body>
</html>
Posted in General | 1 Comment

How to handle Auto Save Mode in Dynamics CRM 2013

Please make your plugin and workflow design as per below suggestion for Auto Save mode in Dynamics CRM 2013:

Plug-in design

Your plug-in design should take into account a web form feature known as auto-save. In the web application entity forms, there is no Save button. The Microsoft Dynamics CRM 2013 web application automatically saves changed data in the form when needed. Depending on how you registered your plug-in, this may result in your plug-in being called very frequently for individual field changes instead of one plug-in invocation for all changes. The auto-save feature only applies to web forms for contact, opportunity, leads, account, and case entities.

It is a best practice to register your plug-in or custom workflow activities on entities and specific fields that matter most. If you can avoid it, do not register your plug-in for changes to all entity fields.

To handle “Auto Save” in JavaScript
JavaScript function getSaveMode(), returns a value indicating how the save event was initiated by the user.
For Example,
function stopAutoSave(context) {
var saveEvent = context.getEventArgs();
if (saveEvent.getSaveMode() == 70) { //Form AutoSave Event
saveEvent.preventDefault(); //Stops the Save Event
}
}
Below table describes the supported values returned to detect different entity records may be saved by the user.

Entity Event Mode Value
All Save 1
All Save & Close 2
All Save & New 59
All Auto Save 70
Posted in MS CRM 2013 | Leave a comment

Error: Unable to load plug-in Assembly for offline plugin in Dynamics CRM 2011

I am getting weird error “Unable to load plug-in Assembly” for offline plugin in Dynamics CRM 2011.
plugin3
And after downloading log file the error details is as “Public key token af134b872b327f03 is not found in allow list”. I have searched and found solution for this.

The Microsoft Dynamics CRM 2011 platform applies an additional security restriction to registered offline plug-in assemblies. When Microsoft Dynamics CRM for Microsoft Office Outlook with Offline Access is installed, an AllowList key is added to the system registry on the client computer. For each assembly containing an offline plug-in that you register, you must add a registry sub-key under the AllowList key with the key name derived from the assembly’s public key token. Failure to add this key results in the offline plug-in not being executed by the platform even though the plug-in is registered.
Obtain the Public Key Token

  1. Load the assembly containing the offline plug-in into the Plug-in Registration tool.
  2. Select the plug-in assembly in the tree view of the tool.
  3. Copy (Ctrl+C) the value in the Public Key Token field and paste it in notepad.

plugin1
Add an AllowList Key in Registry

  1. Run the registry editor by selecting Start, then select Run and type regedit.exe.
  2. In the tree view pane, navigate to the AllowList key. The complete path of the key is HKEY_CURRENT_USER\Software\Microsoft\MSCRMClient\AllowList.
  3. Select the AllowList key and right click to display the context menu.
  4. Select New then click Key to create a new sub-key.
  5. Paste the public key token value into the name of the new sub-key.
  6. Close the registry editor.

plugin2

Posted in MS CRM 2011 | Tagged , , | Leave a comment

How to disable a form control in Dynamics CRM 2011 using Javascript

To disable a form control in Dynamics CRM 2011 using Javascript try below code:

var control = Xrm.Page.ui.controls.get("fieldname");// like new_age
control.setDisabled(true);
Posted in MS CRM 2011 | Tagged , , | 1 Comment

Write a common plugin for Create/Update/Delete events in Dynamics CRM 2011

If you want to write a common plugin for Create/Update/Delete events in Dynamics CRM 2011 then only you need to take care of “context.InputParameters["Target"]“. In case of Create/Update event “context.InputParameters["Target"] is Entity” and in case of Delete event “context.InputParameters["Target"] is EntityReference”. Below is the sample code for the same:

public void Execute(IServiceProvider serviceProvider)
{
     // Obtain the execution context from the service provider.
     IPluginExecutionContext context = (IPluginExecutionContext)
     serviceProvider.GetService(typeof(IPluginExecutionContext));
     // Obtain the organization service reference.
     IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
     IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
     // The InputParameters collection contains all the data passed in the message request.
     if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
     {
          if (context.MessageName == "Create")
          {
               //Code to be executed during Create event of an entity
          }
          else if (context.MessageName == "Update")
          {
               //Code to be executed during Update event of an entity
          }
      }
      else if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is EntityReference)
      {
          if (context.MessageName == "Delete")
          {
              //Code to be executed during Delete event of an entity
          }
      }
}
Posted in MS CRM 2011 | Tagged , | 2 Comments

How to retrieve dynamic marketing list member in Dynamics CRM 2011

To retrieve dynamic marketing list member in Dynamics CRM 2011 follow below steps:

  • Pass list Guid as string and it will return dynamic marketing list member
private EntityCollection RetrieveDynamicMemberList(IOrganizationService service, string strList)
        {          
            ColumnSet cols = new ColumnSet(new string[] { "query" });

            // GUID of the Dynamic Marketing List
            var entity = service.Retrieve("list", new Guid(strList), cols);
            var dynamicQuery = entity.Attributes["query"].ToString();          
            EntityCollection dynamicmemberec = service.RetrieveMultiple(new FetchExpression(dynamicQuery));
            return dynamicmemberec;
        }
Posted in MS CRM 2011 | Tagged , | Leave a comment