Creating custom views on Survey in Sharepoint

For other lists within sharepoint we have an option of
creating our own custom views.


However we have no such option in case of Survey. To create
our own custom view in case of survey we can do the following

First get the id of your survey. For this select view source
of the following page

of your survey.

You can get the id of the survey at following line


The id of the survey list is – 545889cc%2D1be0%2D463d%2Dbaa2%2D6dbec360ba68



%2D is equal to

Now we need the url where in we
will use the above list id for creating custom view

For this create a simple IssueTracking
list or any other list for which we have an option of creating custom view.

Now select setting–>create
view for that newly created list

Copy the url


Get this much part of the url


%7B is equal to {

%7D is equal to }

Modify it in the following manner



http:// servername:12345:12345/_layouts/ViewType.aspx?List={545889cc-1be0-463d%2Dbaa2-6dbec360ba68}

i.e replace the list id.

Now you should be able to create your own custom views on surveys

The request failed with HTTP status 401: Unauthorized. Mandatory updates for Microsoft Dynamics CRM could not be applied successfully

We faced this problem while installing  CRM outlook client in one of our laptops.

I  followed the instructions mentioned below which i found while searching for the same.

On the client computer open the control panel.
Open the User Accounts icon.
Click the Advanced tab.
Click Manage Passwords.
Click Add.
Enter the server name of the CRM server
Enter the username as domain\username
Enter the password.
Click OK, then click Close and then click OK.


On the client open IE, click the Tools menu and then click Internet Options.
Click the Security tab.
Click the Local Intranet icon.
Click the Sites button.
Click the Advanced button.
Enter the website for access Microsoft CRM and then click the Add button.
Click OK 3 times.
Close any open IE sessions.

The problem got solved for us !


Failed to execute web request for the specified Url (SharePoint)

I was getting this error while trying to build a report ( using sql server reporting services) using xml as a data source against Lists web service of SharePoint.

I was making use of GetListItems method of the Lists web service.

Finally the error was fixed by using Fiddler(web debugging tool) within which we easily view the request and responses sent back and forth.

Using it I checked the soap request being passed to the web service and was able to correct the error.

For using the web service (Lists) I followed the following steps.

Selected Data Source type as XML

Connection String as the url of the web service


And the following query


<Method Namespace= Name=GetListItems>


<Parameter Name=listName>

<DefaultValue>Employee Satisfaction Survey</DefaultValue>








Using Web Service as a Data Source in Sql Server Reporting Services

Suppose this is a simple web method inside a web service in ASP.NET.


public string HelloWorld(String FirstName, String LastName) {

return “Hello “ + FirstName+ ” “ + LastName ;


Now we would to add the above as a xml data source in out Report.

For this we need to do the following

  • Create a new Report
  • Select <New DataSet..>
  • For Type (inside General Tab) select XML as DataSource type.
  • Inside connection string give the path to the web service.
  • i.e. http://localhost:2584/WebSites/Service.asmx
  • Define query for the data source in the following manner


<Method Namespace= Name=HelloWorld>





We can create report parameters for FirstName and LastName parameters of the method.

Or we want to define default values for these parameters define the query as following



<Method Namespace= Name=HelloWorld>


<Parameter Name=FirstName>



<Parameter Name=LastName>









Developing Custom Workflow Activities in CRM 4.0

We can create our own custom workflow activities and register it so that they can appear inside workflow editor in CRM.

For creating custom workflow activity we need to first select Workflow Activity Library project template inside Visual Studio with framework version 3.0.

Class within the activity library should derive from Activity class or could derive from SequenceActivity class.

Let’s create a simple custom workflow class

For this add a class inside your Workflow Activity Library project.

Add reference to Microsoft.Crm.Sdk and Microsoft.Crm.SdkTypeProxy dlls.

using System.Workflow.ComponentModel;

using System.Workflow.Runtime;

using System.Workflow.Activities;

using System.Workflow.Activities.Rules;

using Microsoft.Crm.Workflow; 

namespace MyWorkflow


[CrmWorkflowActivity(“My First Custom Activity”,“My Custom Activity Group”)]

public class MySimpleCustomActivity :Activity


protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)


// custom logic

return ActivityExecutionStatus.Closed;





CrmWorkflowActivity Attribute – To allow our activity to be visible inside the workflow editor. First parameter is the name of the workflow activity and second parameter is the group name, which could be used for grouping similar kind of workflow activities.

We can create custom activity by inheriting SequenceActivity class, which would be a composite activity wherein we can add other activity available with windows workflow foundation like

IfElseActivity,IfElseBranchActivity,PolicyActivity,DelayActivity etc.

For this right click on your project and add a new Activity in your project.

Open it in design mode. We can see the option of (Drop Activities Here)

Therein we can drop the built in activities found in windows workflow foundation for building our custom logic. Here we need not override the Execute method like we did in earlier case. The sequence activity will execute the activities that we would have dragged and dropped for writing our logic.

[CrmWorkflowActivity(“My First Custom Activity”, “My Custom Activity Group”)]


public partial class Activity3: SequenceActivity


public Activity3()






While building our workflow we could also define input and output parameter that will appear inside Set Properties dialog box while defining Step and Dyanmic Value editor inside Form Assistant respectively.

To define input and output parameters we need to make use of dependency property and CrmInput and CrmOutput Attribute.



public string InputProperty


get { return (string)GetValue(InputPropertyProperty); }

set { SetValue(InputPropertyProperty, value); }



public static readonly DependencyProperty InputPropertyProperty =

DependencyProperty.Register(“InputProperty”, typeof(string), typeof(nameOfActivityClass));


Similary we can define output parameter only difference would that we will use [CrmOutput(“FullName”)] attribute.

CrmDefault attribute is optional one.


The same property could act as both input as well as output parameter.





public string MyProperty


. . . .



The following data type are supported that could be used as input/output parameter


String, CrmNumber, CrmDecimal, CrmFloat, CrmMoney , CrmDateTime, CrmMoney, CrmBoolean, Status, Picklist, Lookup.


For lookup we can specify the parameter as following





public Lookup TerritoryProperty


get { return (Lookup)GetValue(TerritoryPropertyProperty); }

set { SetValue(TerritoryPropertyProperty, value); }



public static readonly DependencyProperty TerritoryPropertyProperty =

DependencyProperty.Register(“TerritoryProperty”, typeof(Lookup), typeof(Activity1));

For picklist




public Picklist AddressTypeProperty


get { return (Picklist)GetValue(AddressTypePropertyProperty); }

set { SetValue(AddressTypePropertyProperty, value); }



public static readonly DependencyProperty AddressTypePropertyProperty =

DependencyProperty.Register(“AddressTypeProperty”, typeof(Picklist), typeof(Activity1));


Using CrmService and MetadataService within custom workflow activity through workflow context

We can register our own custom services with workflow runtime. The built in services provided by Windows workflow foundation are following

PersistenceService, QueuingService, SchedulerService, TransactionService, TrackingService etc.

Similary MS CRM has used it to register ContextService with the runtime. It provides the current context information for the workflow instance which is executing at that time.

protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)


IContextService contextService = (IContextService)executionContext.GetService(typeof(IContextService));

IWorkflowContext context = contextService.Context; 

ICrmService crmService = context.CreateCrmService(); 

IMetadataService crmMetadataService = context.CreateMetadataService(); 


return ActivityExecutionStatus.Closed;



For registering the custom activity we need to use Plugin registration tool.

Open Plugin Registration Tool

Select Register New Assembly

Select you assmebly ( It should be signed assembly and no need to specify anything else within the plugin registration tool).

Click on Register Selected Plugin

Restart Crm Asynchronous Service


Unable to find a version of the runtime to run the application

I was facing the problem while trying to run one of my windows application created in Visual studio 2005 using .NET framework 2.0.

Few days back the application was running fine and today it on trying to run it i was getting the error.

The way it solved for me was to again open the project in solution explorer in visual studio and rebuilding it.