After migrating CRM 4.0 to CRM 2011, CRM is throwing an exception : A potentially dangerous Request.Form value was detected from the client

by Chinmay 22. October 2011 03:50

I recently observed a scenario where a CRM 4.0 database was upgreaded to CRM 2011 and after upgrade process uses were not able to perform any kind of operation within CRM. The exception that we found was :

A potentially dangerous Request.Form value was detected from the client (crmFormSubmitXml="<iteasy_postcode><it...").;Hash='1073421037'

This is because ASP.Net 4.0 now has a different behvaior and it inspects all request data. Rather that being the cookies, urls, headers, etc. This behavior is controlled by RequestValidationMode property.
Now to override this behavior for CRM 2011, all you need to do is set <httpRuntime requestValidationMode="2.0" /> in your web.config. This setting will enforce request validation in .Net 2.0 mode i.e. only Form's input fields are checked for invalid HTML input.

Tags: , ,

CRM 2011 | CRM 4.0

CRM 2011 and Application File Privilege

by Chinmay 18. October 2011 02:50

Recently I was asked what exactly Application File Privilege found under Core Records affects within CRM. After some research on the topic I found that it holds Schemas and Templates as mentioned below :

CRM 2011 Application File Privilege

RibbonCore
AdHocReportTemplate
RibbonWss
FormXml
RibbonTypes
SpreadsheetMLTemplate

One of the practical usages of AdHocReportTemplate is to apply changes to your Ad Hoc Reports by modifying this template. Here is a link that demonstrates how to do so : http://blog.sonomapartners.com/2008/11/customizing-the-report-wizard-template.html

Tags:

CRM 2011

CRM 2011 Exception : The key specified to compute a hash value is expired, only active keys are valid

by Chinmay 10. October 2011 01:14

This one is a well known error for people who have worked with CRM 4.0 and an easy fix was to restart CRM Async Service.

The key specified to compute a hash value is expired, only active keys are valid. Expired Key : CrmKey(Id:a06a2c71-e96a-e011-ae0c-000c29ce8648, ScaleGroupId:00000000-0000-0000-0000-000000000000, KeyType:CrmStaticVersionScaleGroupKey, Expired:True, ValidOn:04/20/2011 00:59:35, ExpiresOn:06/19/2011 00:59:35, CreatedOn:04/20/2011 00:59:35, CreatedBy:CRM\Administrator.

The same error when it comes to CRM 2011, you might have to restart

Microsoft Dynamics CRM Asynchronous Processing Service 
Microsoft Dynamics CRM Asynchronous Processing Service (maintenance)

followed by an IIS Reset.

Tags: ,

CRM 2011

CRM 2011 Multiple Sub-Grid OnLoad Fix

by Chinmay 6. October 2011 19:24

I was recently working with a client where I had to come up with a multi-grid form for Case entity and wanted to display related activities in each grid. And they wanted to display around 6 different types of activities to be available on Case form.

After adding the sub-grids I came to notice a strange issue and as such it does make sense to load records as and when we need them, that is not what my client wanted. Basically what was happening is after I added the sub-grids, only first 4 grids will load the data when form is loaded. Fifth grid onwards I will get a link which will ask me to click on it if I need to see records. This is in fact a good solution to avoid loading unnecessary data and improve performance, client was not happy with that solution. And I was asked to come up with a workaround, it is pretty simple trick as such but can come really handy. You might want to polish it a bit like- make sure that you don't click on any other link except the one within the grids and maybe some more checks just in case there are other elements with the same class id.

All you need to do is to include this script, on OnLoad of the form along with the jQuery minified library[which you will have to add and make it available on your form.]

function CrmXpress.Scripts.UI.SubGridLoadFix() { 
  
    $(document).ready(function () { 
  
        var links = $("a.ms-crm-List-LoadOnDemand") 
        for (i = 0; i <= links.length; i++) { 
            try { 
                links[i].click(); 
            } 
            catch (e) { 
                // Handle for other errors, or safely ignore 
            } 
        } 
    } 
); 
}

Have fun and Happy Coding.

 

Tags: , ,

Code | CRM 2011 | DHTML

Comment Your Code... Quickly And Efficiently with GhostDoc

by Chinmay 10. May 2011 05:48

 

Everyone loves well commented code [when they are reading the code] but when it comes to add comments in their own code, well people are not that generous. And it is not that they don't want to add comments but XML adding XML comments to event handler can be really really tedious and kills productivity. So if you love to comment your code but have to skip it 'cause it is a lot of extra work then look no further. Here is a Visual Studio add-on that I have used for quite a while. It is called Ghost Doc [http://submain.com/products/ghostdoc.aspx]. It is pretty simple to use and has a rich set of configuration option. If you are looking for more options than there is a licensed version with more features [document entire type/file] is also available.

Check out the following video[Source: submain.com] to see how it works.

 

Tags: , , ,

.Net | C# | Link | Tutorial

Yahoo Mail Gets An Upgrade With a Fresh New UI and Unlimited Storage

by Chinmay 5. May 2011 10:16

Whoa!!! This is big. I generally do not use Y! as a mail service. I've moved on to Gmail for a while for plethora of reasons. And suddenly I got a mail from Y! saying that they are going into a beta and I thought let me give it a try and I must say it is surprisingly fresh UI. Check it out the screenshot below. Apart from that you can also see applications on the left side navigation - Social Networks, Storage, Photos and more. And all these come with unlimited storage.

Tags: ,

News | Yahoo

Visual Studio Task List and Comment Tokens

by Chinmay 4. May 2011 06:14

As part of my job I do a lot of code review, refactoring and maintenance. Many a times I would leave instructions to my teammates, well I could always write an email or maybe send an excel file for a large codebase.  However, I am very fond of using one (not so popular) Visual Studio feature called Task List[http://msdn.microsoft.com/en-us/library/170k1bbs(v=VS.100).aspx]

Few reasons I love using Comment tokens are they are much easier to use. They stay with the code and any good developer would want to get rid of a BUGBUG or HACK from his/her code comments. And because they are always there in the IDE it is easy to keep track on the progress as you work through your code.

So here it is how you can set up a set of your own comment tokens to use with Task List.
1. Click on Tools - > Options -> Environment -> Task List.
2. Add as many tokens you want, as shown in the image below

And here is how you will use it in your code.

 

Tags: , , , ,

.Net | C# | Code | Tutorial | Visual Studio 2010

An interesting read from CodingHorror.com - Working with the Chaos Monkey

by Chinmay 3. May 2011 08:51

I do read www.codinghorror.com sometimes and I just stumbled upon this interesting theory... I have not applied it in all of my enagements but during my last job we tried the similar approach and had amazing results.

Check out the original article at : Working with the Chaos Monkey

Tags:

Link

New Prices for Microsoft Certifications Exams

by Chinmay 27. April 2011 07:33

Today Microsoft announced an increase in for various Microsoft Certifications.

This is what the official announcement has to say:

Effective July 1, 2011, the retail price of Microsoft Certifications will increase worldwide.* This change reflects the significant value that our certifications provide to our customers and our continual investment in new and enhanced Microsoft Certifications and other program improvements.

Microsoft recognizes the increased pressures on students and academic institutions during these challenging economic times. Although some of the prices for Microsoft Certification exams for students and academic institutions will increase, the discount will remain significant. Microsoft is dedicated to helping students become more employable for entry jobs in the IT industry. IT Academy members, high school, college, or university students enrolled in a degree or diploma program will continue to receive a discount off the retail price of select Microsoft Certification exams.

Exam prices can vary by country or region. See the Frequently Asked Questions (FAQ) information below for more information regarding this change.

Use our pricing tool to determine your current and future Microsoft Certification exam prices. (requires Microsoft Silverlight)[This is pathetic, they are trying so hard to push silverlight :|]

Note Microsoft Learning does not anticipate that this price increase will impact Microsoft Certified Master (MCM), Microsoft Certified Architect (MCA), Microsoft Technology Associate (MTA), and Microsoft Office Specialist (MOS) Certification exams.

*Price change will be effective in India on August 1, 2011.

The prices in India are going to be USD 80 compared to the old price USD 50, this is 60% increase in the fees. So rush and take advantage of the low prices before 1st August 2011.

You can find the official announcement at : http://www.microsoft.com/learning/en/us/certification/cert-pricing-FAQ.aspx

Tags: , ,

Link | Microsoft | News

The Hidden & Dangerous UTF encoding traps

by Chinmay 21. April 2011 06:21

Now let's face this, we all work with Text in our day to day lives [If you don't, kindly do let me know what kind of work you do?] and it is funny how we ignore some basics of the game. I've been myself victim of these traps before but as I spent more time dealing with them I found out some really simple solutions to some really strange problems.

Recently, a friend of mine was testing an MSI Installer which was custom built by his Dev team for automated installation and deployment. One of the purposes of that installer was to auto configure certain server parameters. Now that configuration was done using a VBS. Now they were rushing for a release and timeline was short. As such it was a straight forward process, so he ran the MSI and within a few seconds he was presented with a weird error. And Installer aborted. Now this was not the first time that installer was being used. It was used across teams in that group and was in practice for a while now. I was standing by him when this was going on so I offered him my help and he happily agreed.

Now first thing I did is to check Eventlog. [I work with Microsoft Dynamics CRM most of the times, so this has become my habit] and indeed there was an error recorded under Windows Installer. On checking that error we found out a script necessary to run this setup was failing and due to that failure Setup cannot continue.  So we knew that it is coming from

So I asked him to run the script manually by double clicking it. The script instantly gave an error, and the error was there was an invalid character on line 1, position 0. So we opened the file in Visual Studio and it was a simple On Error Resume Next nothing fancy no magic there.

Now the same installer approach was working fine for other teams and my friend just copied the scripts and made his own installer. Now keyword here is "copied", so I asked him from where and how did he copy it? He said he used Remote Desktop. And it striked me that this could be the issue because of the codepage and maybe during the copy something was messed up. I asked him to copy the script file to his notepad and save it as a VBS file and then putting it back. The same file and the same content worked absolutely fine.

Same goes with XML as well, the encoding type specified in header can baffle you sometimes. A perfectly valid XML might also give an error if you try to open it with Internet Explorer 8 or below.

So next time you are facing some weird error in otherwise perfect text file I suggest you try fix the encoding before you dive in somewhere else.

Tags: ,

Code | General | Tutorial

About Me

I've been working on CRM since last 6 years and I am mesmerized by the sheer capabilities of this product. This blog is a medium via which I will try to share my various experiences on CRM, .Net, DHTML and a lot more. If you like my blog please leave a comment and/or rating on the posts.

#1
#2
#3
Questions Answered
Overall Points
quot;


Subscribe in a reader

Calendar

<<  May 2013  >>
MoTuWeThFrSaSu
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

View posts in large calendar