Thursday 29 September 2011

Good to have Utilities during development and deployments

Stunnware for CRM QueryBuilder
http://www.stunnware.com/default.aspx?area=products&group=swtools4
also check http://arvindcsit.wordpress.com/sitemap/ for other crm tools

Fiddler to check exchange of web-request and responses
http://www.fiddler2.com/fiddler/version.asp

Microsoft SQL Server 2008 R2 Report Builder 3.0
To create custom reports for MS CRM 2011
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6116

Cross Loop Download
For screen sharing and taking control of other user's desktop
https://www.crossloop.com/download.htm?affid=xl&src=global_header_download_link

AgentRansack
To search through the folders and sub-folders for a file or some text within files
http://www.download3k.com/Install-Agent-Ransack.html

TreeSize
To check the size of folder and subfolders, good for quickly finding a folder which is taking most of the disk space.
http://www.jam-software.com/treesize_free/

Orca: Use this to update installer's properties
http://www.technipages.com/download-orca-msi-editor.html

To check if there is a dependency missing
http://www.dependencywalker.com/

NetWrix Password Expiration Notifier: Check password expiration on AD and sends an email to users
http://www.netwrix.com/download.html?item=FCA513AE-445A-4a7b-B990-BF1525721769

SiteMap Editor
http://sitemapeditor.codeplex.com/releases/view/87898

Virtual CloneDrive: for using cd images
http://www.softpedia.com/get/CD-DVD-Tools/Virtual-CD-DVD-Rom/Virtual-CloneDrive.shtml

Beyond Compare: to compare folders and files
http://www.scootersoftware.com/download.php

CRM 2011 Customization Comparer
http://crmcustomcompare.codeplex.com/

DebugView
http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx

CRM Many to Many Import export
http://crmmanytomany.codeplex.com/

Assembly decompiler (Free)
http://www.telerik.com/products/decompiler.aspx?gclid=CNLOreio_rQCFTDMtAodyngArw

UML tool
http://www.visual-paradigm.com/download/vpuml.jsp

SMTP
https://smtp4dev.codeplex.com/

Camtasia (video recording tool)
http://www.techsmith.com/camtasia.html?gclid=CjwKEAiA3IKmBRDFx-P_rLyt6QUSJACqiAN8LMs0Dsz3ZPZ4zsL_Kb6DKMSMWEv1clO72oHwN5HOBxoCxK7w_wcB

Anti-Malware products removal tools
http://answers.microsoft.com/en-us/protect/wiki/mse-protect_start/list-of-anti-malware-product-removal-tools/2bcb53f7-7ab4-4ef9-ab3a-6aebfa322f75


Fix it
https://support.microsoft.com/en-us/mats/program_install_and_uninstall?wa=wsignin1.0


Disassembler
Dot Peek (used it found it good and its free)
https://www.jetbrains.com/decompiler/


Good but not free trial available though
http://www.red-gate.com/products/dotnet-development/reflector/


ILSpy (free)
http://www.red-gate.com/products/dotnet-development/reflector/


Bit Differ (free) to compare two assemblies to find the difference
http://www.bitwidgets.com/

Monday 26 September 2011

Install new version of .net framework sdk to run gacutil

if following message is shown when running gacutil
"this assembly is built by a runtime newer than the currently loaded runtime"

This mean Gac utillity verion being installed on machine is older then the version the assembly being built in my case assembly was of .net framework 4.0,

Solution:
Install the latest version of .net framework sdk.

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=8279

use following path to run the gac

C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools

execute the following command

gacutil -i "c:\assemble.dll"

the gac folder path is
C:\Windows\Microsoft.Net\assembly\GAC_MSIL\

to list all the assemblies in the gac

gacutil -l

to list all the assemblies in the gac into a file
gacutil -l  > "c:\assembliesfile.txt"


to look for a specfic assembly in the gac
gactuil -l "assemblyname.dll"

.Net 4 gac path "%windir%\Microsoft.NET\assembly\"
.Net2 gac path "%windir%\assembly\GAC_MSIL"

to find the public token key
sn -T EdmGen.exe
Public key token is c11d6c2346788e890

the breakpoint will not currently be hit

Saturday 24 September 2011

CRM 2011, using IFD organisation service from code

IFD organisation
url = @"https://org.domain.com/XrmServices/2011/Organization.svc";
username = @"domain\username";
password = "pass123";


ClientCredentials credentials = new ClientCredentials();
            credentials.UserName.UserName = username;
                credentials.UserName.Password = password;

                Uri organizationUri = new Uri(url);
                Uri homeRealmUri = null;

                OrganizationServiceProxy orgService = new OrganizationServiceProxy(organizationUri, homeRealmUri, credentials, null);

OrganizatinoResponse response = orgService.Execute(new WhoAmIRequest());

orgService.Dispose();


Registering Http module in CRM 2011

We had a requirement of showing Terms and Condition page for the first time logged in users of IFD CRM.

We created a http module and registered a webresource as a T & C page.

To build http module.

Create a class library project
add the assembly of System.Web, and Implement the interface IHttpModule

Sign the assembly, by going to project properties and selecting signing tab, and then select sign the assembly,
Then enter following command and replace <<dll name>> with the acutall dll generated.

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\sn.exe -Tp <<dll name>>

http://www.crmexper.com/?p=82

Paste the http module dll into the following folder
C:\Program Files\Microsoft Dynamics CRM\CRMWeb\bin

Open the web.config file present at following folder
C:\Program Files\microsoft CRM\CRMWeb

and add the following line where other http modules are already present
      <add name="TNC" type="NS.TandCModule, TandC Http Module, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d4bbd2a97381a7c1" />

Here,
name is any unique httpmodule value
NS.TandCModule basically represent the fully qualified namespace and class name
TandC Http Module, is the dll/assembly name which I copied into bin folder
Version=1.0.0.0, is the version of dll which can be checked by going to project properties->assembly and then pressing the Assembly information button.

PublicKeyToken is the value which is shown when used the sn.exe command

There is no need to restart IIS for website to pick the HTTP module.

early binding

Thursday 22 September 2011

Troubleshooting IFD crm2011

-----

If the message says "You are trying to create a new user which does not exists in ... domain", then reset dns setting on front end server (where CRM front end is installed).

run command line and enter following lines and wait for at least couple for changes to take effect.
ipconfig /flushdns
ipconfig /registerdns

check if crm is showing pages normally, if some of the pages/ icons are not showing, reset IIS

--
if showing IFD login screen and after login shows error message with some reference number being shown by ADFS service, then open ADFS configuration manager, UPDATE relying party trust record.

--

if backend ADFS machine is restarted then wait for at least 10 mins for adfs to load all the changes. there will be some error initially in event viewer about domain not found.

--



Wednesday 21 September 2011

Importing large solutions in CRM 2011 failes

I created a solution in my local envirnoment and when trying to import it into to production envirnoment. The import screen shows some progress initially then it hangs the screen, and in event viewer there are lots of messages of query time out.

To overcome this issue follow this url, though its written for crm 4 but works for crm 2011 as its a sql time out issue, I applied both of the methods mentioned in the link, and it worked fine.

http://support.microsoft.com/kb/918609

ADFS Error


Issue occurs when using  self-signed or domain issued certificate, Resolution is to use the powershell command for AD FS 2.0 to configure the revocation settings for the EncryptionCertificateRevocationCheck.







PS C:\Users\administrator.VSC> add-pssnapin microsoft.adfs.powershell

PS C:\Users\administrator.VSC> SEt-ADFSRelyingPartyTrust -TargetName auth.vsc.com -EncryptionCertificateRevocationCheck

None



Monday 12 September 2011

Installing CRM Server on Multiple Machines

Machine 1: SQL-Server + Reporting Services
SQL Server with reporting services and full text feature on one machine. 
To install reporting extension run SetupSrsDataConnector msi present in SrsDataConnector folder of CRM2011.

Machine 2: Front End
Run SetupServer msi present in CRM2011 extraction files, and when shows the screen of roles select FrontEnd and Depolyment Services
This creates a CRM_Config database on Machine 1, and creates CrmApp application pool, website, and installs webservices.

Machine 3: Backend
Run SetupServer msi present in CRM2011 extraction files, and when prompted for roles select BackEnd and Deployment Services.
When shows the option for new deployment or existing select existing as we have already created from Machine 1. This installs the Async Services and Web services, to run plugin and async operations.


Note: Runing these steps don't install any organisatin, to install organisation run the deployment manager on machine 2.

Sunday 4 September 2011

Reports in CRM 2011

Run the Report Builder 3.0,
Download "Microsoft SQL Server 2008 R2 Report Builder 3.0"  from http://www.microsoft.com/download/en/details.aspx?id=6116

Connect to Report Server "http://<computername>/reportserver"

Create a Data Source ".;db_mscrm"
Create a new Dataset -> select the above mentioned data source and use the following query
"select column1,column2 from filterednew_customentity" to show records user has access to,
OR
"select column1,column2 from filterednew_customentity as CRMAF_Filterednew_customentity" to show records user has access to and also context sensitive i.e. for the records user selected/or currently viewing entity record.

Drag and drop columns on report, Preview report and then save report

In CRM go to workplace and select reports and click on new 
Report Type: Existing File
File Location: "browse the file created and saved earlier"
Name: Basic Custom Report
Description: Report description
Categories: <<blank>>
Related Records: new_customentity "this is the entity for which the report is created for"
Display In: Forms for related record types;Lists for related record types;Reports area
Save,

Open the form for custom entity and click on Reports button and browse the report.

------------------------------

When creating a custom report for CRM 2011 and using explicit filtering. Create a parameter with the name of CRM_FilteredEntity and type of text, 

In this example, I am trying to create a very basic report where I show statuscode of Cases (Incidents). For that I followed following steps.

1. Created a Parameter of type text with name of CRM_FilteredEntity

2. Created a DataSet with the following query

declare @sql nvarchar(max)
set @sql = 'select statuscode from ('+@CRM_FilteredIncident+') as incident';
exec(@sql) 

and when clicked okay, 
When prompted, I entered "select statuscode from FilteredIncident" to populate dataset with fileds.

3. Draged and drop field on report.




Explicit reports do not include context sensitive records i.e selected records can not be shown in report, however this can be achieved by custom methods e.g creation of ribbon button and then passing selected values to report server url with selected parameters.

http://www.njevity.com/blog/creating-dynamics-crm-2011-reports-sql-reporting-services-pre-filtering-and-default-filters
http://gtcrm.wordpress.com/2011/03/24/fetch-xml-reports-for-crm-2011-online/

----------

When defining data source for the report use embedded option, when report is uploaded to crm or different server, CRM is clever enough to ignore the data source details embedded into report.

How to Enable Tracing in CRM 2011 (Diag Tool)

Sometimes error message from Microsoft CRM is not detailed enough to find the exact root cause. Diagnostic tool is used to write trace log of CRM into files.

Download Diag tool from http://cid-57142f3d072ab525.office.live.com/self.aspx/CRM%202011%20Tools/CrmDiagTool2011.zip

Click on enable tracing.

if tracing is not working after you enabled the tracing, the follow following steps

To enable tracing update registry details

Regedit - take backup of registry before making any changes, just in case...


Computer->HKEY_LOCAL_MACHINE->SOFTWARE->MICROSOFT->MSCRM

Add registry entries if not already exists

Value name = TraceDirctory, Value data =  C:\CRMTrace, Type -- String
Value name = TraceEnabled , Value data 0 ,  Type--DWord (32-bit)
(0:disable, 1: enable)
Value name = TraceRefresh, Value data = 6, Type -- DWord (32-bit)

After updating registry entries, restart IIS.

Here even when specifing tracing info the trace will be written at C:\CRMTrace it been written at
C:\Program Files\Microsoft Dynamics CRM\Trace

Turn off tracing by chaning TraceEnabled registry value to 0

To read the trace log file

http://www.stunnware.com/crm2/topic.aspx?id=tracelogviewer

Thanks