Tuesday, June 26, 2012

CRMSvcUtil.exe parameter is incorrect

Today i have got a strange message while creating early bind class code even i have entered correct parameters in command line.
error: Parameter is incorrect
I have use following command
CrmSvcUtil.exe /url:https://myorg.crm.dynamics.com/XRMServices/2011/Organization.svc
    /out:GeneratedCode.cs /username:"myname@live.com" /password:"myp@ssword!" 
Which is correct.
Then i got a solution and decided to share with you
go to the below location
C:\Users\Mubasher(your username)
and delete the folder
LiveDeviceID

Run the above command again.
I hope it helps you. Please share your experience in comments.
For more help on CrmSvcUtil.exe Extension Usage and Command-Line Parameters please check the following link
http://msdn.microsoft.com/en-us/library/gg695820.aspx

Saturday, June 9, 2012

How to Display a Report in a Dashboard in Dynamics CRM 2011?

There are a lot of reasons to display a Report within a Dashboard. And i have decided to write my own blog for this purpose And take help from this blog. So today i am sharing the steps so you can do it on your project too.
1. Run the report you want to display in a Dashboard.
2. Press F11 Copy the URL that displays in address bar
3. Create a New Dashboard. Chose any layout that fits in your requirement
4. Insert an IFRAME in the Dashboard.








5.  Paste the above Url after making the following adjustments to it:
  • Remove “http://myservername/myorgname” . This will make your url relative.
  • Replace “?action=filter” with “?action=run”. This will bypass the first step before running the report where CRM asks for some parameters.
for instance, if the original url was:
http://crm-vm222/MyOrg222/crmreports/viewer/viewer.aspx?action=filter&helpID=My%20Report%20Name.rdl&id=%7bE70C6DCA-31FF-E011-807F-CCCC293AE41E%7d
..then, you should write:
/crmreports/viewer/viewer.aspx?action=run&helpID=My%20Report%20Name.rdl&id=%7bE70C6DCA-31FF-E011-807F-CCCC293AE41E%7d

6. Also, clear checkbox ‘Restrict cross-frame scripting’ . At least in my case I had to do that to make it work.



7. Use the buttons ‘Increase Width’ and ‘Increase Height’ so as to make the IFRAME fill the whole page of your Dashboard (or just the space it’s supposed to need).


8. Save & Close the Dashboard.
9. Publish the Dashboard.
10. Try It! :) . After publishing make some minor changes like size / layout depending upon your requirement.But our main pupose has been achieved which is displaying the report.
Hope it helps,

Friday, June 8, 2012

How to remove a primary field of the lookup view in MS CRM 2011

Hi All.
Some people wants to remove primary field from lookup view. This is a system column and cannot be removed in a supported manner you could just set its width to minimum.


There is only one unsupported customization available for this

1. Export Your entity.
2. Open customization XML.
3. Find Your Lookup View from XML.
4. Remove the desired field from view.
5. Save and import customization.xml to CRM.
6. Publish your entity.

Note: This is unsupported customization.


How to set Option set value to null CRM 2011


Option set does not accept NULL to clear its value so you need to write the code like below

function clearOptionSetValue()
{
var Prioritycode = Xrm.Page.data.entity.attributes.get("prioritycode");
Prioritycode.setValue(null);
}