Tuesday, February 28, 2012

Using SetStateRequest to deactivate Contact record.

Recently I wintered to deactivate contact entity for some scenarios. below is the piece of code which I used to do it so.



public void DeactivateContact(Guid contactId)
{
try
{
SetStateRequest setStateRequest = new SetStateRequest();
setStateRequest.State = new OptionSetValue(0);
setStateRequest.Status = new OptionSetValue(1);
setStateRequest.EntityMoniker = new EntityReference(Contact.EntityLogicalName, contactId);

service.Execute(setStateRequest);
}
catch (Exception exception)
{
throw exception;
}
}

Monday, February 27, 2012

Visual Ribbon Editor for MS CRM 2011

In CRM 2011 Editing ribbon is a very hard thing. because we have to change lot of xml files. But Visual Ribbon Editor is a wonderful tool which will enable you to edit CRM ribbon more easily, definitely it will make your life more easier .

You can download it from codeplex

Sunday, February 26, 2012

Reload CRM 2011 sub-grid manually

Recently I wanted to add a subgrid to the one of my CRM form. It's a simple thing you just want to follow the normal procedure.

1. Settings - Customizations - Customize the System

2. Open the entity form and go to the Insert tab and click on Sub-Grid button


3. Now give a name for "Name" field then select Entity and Default View
ntity form and go to the Insert tab and click on Sub-Grid button

That's it. Save and publish the form.

Normally now all of the sub records should populate in the main form load. But in my case it didn't load the sub grid records, so just had to find a reason for that. actually in my main CRM form there were more than 10 sub grids. Finally I came to know that it will load only first 5 sub grids in the page load. So then we need to manually load my sub grid using javascript. It was not that much default you can simply use the following javascript code.




var grid = document.getElementById("SubGridName");
if (grid != null) {
if (grid.readyState == "complete") {
grid.Refresh();
}
}

Thursday, February 23, 2012

CRM 2011 How to change attribute type in database

Recently I wanted to change the attribute type from 'Single line of text' to 'Multi line text' in CRM 2011. but we cannot do from CRM form. but there is a way to do it.

First you have to find the Single line attribute and multi line attribute from the "Attribute" table. and get the attributetypeId.

then simply update the Multi line attributetypeId with single line attributetypeId.

After that you have to Export the Entity and then Import it again to the CRM system.

Now open the Entity Form and remove the attribute and add it again to the form.

Save and Publish the Form.

That's it. now you will see the changes. btw, this is 'UNSUPPORTED' way.

Sunday, July 17, 2011

MVC Movie App tutorial : Unable to find the requested .Net Framework Data Provider. It may not be installed

I got another problem when I work with MVC Movie App tutorial provided by Microsoft Asp.Net site.
I just go through the step by step. But unfortunately I stuck at one point. Once I build the solution and press F5, and I tried to go to the following url. But it says “Unable to find the requested .Net Framework Data Provider. It may not be installed.”

I tried several options and found good solution at this url.

What I did was just replace the connection string given by that url with my connection string. It works perfectly now….

Friday, July 15, 2011

How to change debugging browser used in VS 2010 , MVC 3

Recently I have work with Asp MVC 3 and had a problem with changing my default Brower from Firefox to IE.

In Asp.NET it is possible with “browse with” option. See more details on ScottGu’s blog.
But in MVC project we don’t have any aspx files, so how to configure our solution to do it so?
There is a way to do this.

1. Right click on solution and go to the “Properties”
2. Go to “Web” Tab
3. Set the Start Action to use Start external program and then pass the Internet Explorer executable path and the url as Command line arguments.
4. Set the Servers’ specific port to the same port set in the url in step 3.
See the following image to get more info.

Thursday, July 14, 2011

VS2010 not opening CSS files : MVC 3

Hi all,

I am using Visual Studio 2010 as my development platform. Recently I have install MVC 3 with Web Standards Update for Microsoft Visual Studio 2010. But unfortunately when I try to work with MVC 3 applications I was unable to open CCS file with Visual Studio.

So I just Google it and found the solution. Here is the link .

Try to repair your installed Web Standards Update for Microsoft Visual Studio 2010 SP1 by using following path.

Got to Tools - Extension Manager - Online Gallery and search for/install the "Web Standards Update for Microsoft Visual Studio 2010 sp1"

Then click on repair link. And restart Visual Studio. Hop everything fine now ….

MS CRM 2011 KB Article customization Issue.

Recently I have encountered some issue while customizing Kb Article Entity. I was doing following configuration in Article form. 1. Add Ba...