Monday 28 November 2011

how to disable kernel mode authentication in iis7

%windir%\system32\inetsrv\appcmd set config /section:windowsAuthentication /useKernelMode:false

http://blogs.msdn.com/b/tmarq/archive/2007/08/29/iis7-kernel-mode-authentication.aspx

The account specified to run the Microsoft Dynamics CRM application does not have Performance Counter permissions

Error:The account specified to run the Microsoft Dynamics CRM application does not have Performance Counter permissions.

Resolution: On the machine where CRM installation has to be done. Add the domain account to performance log group.
  1. Open Start -> Administrative Tools -> Computer Management.
  2. Navigate to System Tools -> Local Users and Groups -> Groups.
  3. Select the group Performance Log Users, right-click on it and select Add to Group...
  4. Click on the Add button to select your service account.
  5. Click on the OK button when done.

http://praphullaparab.wordpress.com/2011/03/23/first-look-at-microsoft-dynamics-crm-2011-installation/

Action Microsoft.Crm.Setup.Server.GrantConfigDBDatabaseAccessAction failed.


---------------------------
Microsoft Dynamics CRM Setup
---------------------------
Action Microsoft.Crm.Setup.Server.GrantConfigDBDatabaseAccessAction failed.

Windows NT user or group 'domainname\SQLAccessGroup {a2d9c879-7ee6-48da-90f9-b5370f83a4b9}' not found. Check the name again.


---------------------------
Retry   Cancel  
---------------------------
Resoultion: Make sure sql managment studio is closed on all machines.


http://weblogs.asp.net/pabloperalta/archive/2011/09/01/microsoft-crm-setup-server-grantconfigdbdatabaseaccessaction-failed-windows-nt-user-or-group-mydomain-sqlaccessgroup-not-found-check-the-name-again.aspx

Friday 25 November 2011

CRM 2011, when viewing report it is giving error message

We have done the installation of CRM and installed crm reporting extensions and rollup in this case roll up 4 on SSRS machine, after this done when tried to view built in CRM reports, I got reporting error message, in Event Viewer the error description is

Web service request SetDataSourceCredentials to Report Server http://crmserver/ReportServer failed with SoapException. Error: An error has occurred during report processing. (rsProcessingAborted)

The resolution was quite simple: SQL Reporting services require restart after installation of crm reporting extensions.

Friday 18 November 2011

Open the url in a new window

In order to open the window in new browser, rather then in a tab of already opened browser, use nomerge argument


Process objProcess = Process.Start("IEXPLORE.EXE", "-nomerge http://google.com/");

Thursday 10 November 2011

Url Encode/Decode

System.Web.HtmlUtility.Encode("http:\\www.yahoo.com\main.aspx?audit%20history")

output

http:\\www.yahoo.com\main.asp?audit history

Wednesday 9 November 2011

Step by Step for CRM 2011 plugin

1. Create a class library project,
     Make sure the Target framework is set to ".Net Framework 4"

 2. Sign the assembly by going to project properties and selecting Signing tab, and selecting check box "Sign the assembly", select new and enter name.

 3. Add following references
        microsoft.crm.sdk.proxy
        microsoft.xrm.sdk

4. Add the following namespace to plugin class
using Microsoft.Xrm.Sdk

5. Implement IPlugin interface so it look like e.g

   public class MyPlugin :IPlugin
   {
      public void Execute(IServiceProvider serviceProvider)
     {

      }
    }

6. Build the project and copy and paste the plugin dll and pdb file to

C:\Program Files\Microsoft Dynamics CRM\Server\bin\assembly

7. Open Plugin registration tool, Click on register assembly and select the assembly from the above mentioned location
   Select location as Disk

8.Register new step by selecting the assembly in the plugin registration
  Message: Update
  Primary Entity:contact
Secondary Entity:none
Eventing Pipeline Stage of Execution: Pre-operation (CRM 2011 Only)
Execution Mode: Synchronous
Deployment: Server

9.   In the visual studion, go to process and select attach to process, and select the w3wp process, and add the break point with in execute method.

10. update a contact record. The code break point will hit to debug.

Registering PreImage in plugin

Select Organisation in Plugin registeration tool, and select step and then select register Image,

Entity ent= (Entity)context.PreEntityImages["incident"];
                if (ent.Attributes.Contains("attributename"))
                {
                    string attrValue = (string)ent.Attributes["attributename"];                 
                }



http://crmconsultancy.wordpress.com/2010/10/25/plugins-in-crm-2011/
    

Tuesday 8 November 2011

OData


1. include jquery, and jso library

/////////////////
To hide a field use

Xrm.Page.getControl("attributename").setVisible(true);

if it doesn't work then use

document.getElementById("attributename_c").style.display = "inline/none";
document.getElementById("attributename_d").style.display= "inline/none";

use inline to show, and none to hide the field
////////////////

To change the required field level use

 Xrm.Page.getAttribute("to").setRequiredLevel("required");

valid values are none, required and recommended

///////


function UpdateActivity()
{

    var CRMObject = new Object();
          CRMObject.proprtyname = value;
          updateRecord(guid, CRMObject, "EntityNameSet", null, null)
}

Friday 4 November 2011

Custom ribbon button is disabled after importing solution of customisation

Custom ribbon button is disabled, when imported solution.zip file of solution, everything is fine but buttons shown are disabled,

Resolution: reset iis and re-import customizations

Show dialog on custom ribbon button


Created a custom ribbon button on case entity and on click of button show a dialog. on completion of dialog refresh entity form.
....
<CustomAction Id="NewCancel" Location="Mscrm.Form.incident.MainTab.Actions.Controls._children">
            <CommandUIDefinition>
              <Button Id="NewCancelButton" ToolTipTitle="$Resources:Ribbon.Form.incident.MainTab.Actions.Cancel" ToolTipDescription="$Resources:Ribbon.Tooltip.CancelCase" Command=AbandonCase" Sequence="6" Alt="$Resources:Ribbon.Form.incident.MainTab.Actions.Cancel" LabelText="Abandon Case" Image16by16="/_imgs/ribbon/CaseCancel_16.png" Image32by32="/_imgs/ribbon/CancelIncident32.png" TemplateAlias="o1" />
            </CommandUIDefinition>
          </CustomAction>

....

<CommandDefinition Id="AbandonCase">
            <EnableRules>
              <EnableRule Id="IsExisting" />
            </EnableRules>
            <DisplayRules />
            <Actions>
              <JavaScriptFunction FunctionName="AbandonCase" Library="$webresource:new_incident.js" />
            </Actions>
          </CommandDefinition>

then created a javascript function to show dialog when user click on the custom button


AbandonCase = function () {
    window.showModalDialog(OrganisationPath + "/cs/dialog/rundialog.aspx?DialogId=" + AbandonCaseDialog + "&EntityName=incident&ObjectId=" + Xrm.Page.data.entity.getId());
    refreshEntityForm();
}



refreshEntityForm = function()
{
  //used mainly from ribbon buttons

  if (Xrm.Page.data.entity.getIsDirty())
  {
      // Save form - causes reload
      Xrm.Page.data.entity.save();
  }
  else
  {
     // Reload form.
      window.location.reload(true);
  }
}





Disable all the fields on a form,

Thursday 3 November 2011

CRM 2011 Form Navigation

In CRM 2011 User can create multiple form for same entity which is explained here
http://www.youtube.com/watch?v=JW1LooWhNqc

Once multiple forms have been created, In customization select the appropriate entity form and click on assign role for selected form. This will allow user having the given permission to view form will able to see specific forms created.

There are scenarios when a user has permissions to view multiple forms of same entity but we want to show a form depending on some value on the entity attribute. This is well explained http://www.avanadeblog.com/xrm/2011/06/crm-2011-form-navigation.html link.

Javascript: datetime

Populating field value with the value selected from model dialog

On my Entity form, I created a on field change event and in javascript i am opening a model dialog window, and when user make some selection from it, I return that value back to Entity form.

Entity form

function ValueChanges()
{
 var selectedvalue = window.showModalDialog("htm web resource url", arguments);

}

on htm web-resource
var receivedarugments = window.dialogArguments;

//take some decision and show values to user, and when user selects a value call selectedValue function
function selectedValue()
{
  window.returnValue = "selected value";
   window.close();
}

Can not update fields on workflow

Issuee: When writing a workflow, and adding a step to update record, Some of field are not editable.
Reason: These fields are been marked as readonly
Resolution: Go to customizations, change fields to editable which need updating from workflow, update workflow,  and then go back to customization and set the fields back to read only.