Thursday, November 15, 2012

sharepoint event receiver before after properties

Working with the SharePoint event handlers is the one of the regular requirement we need to work on.

There is lot of confusion while working with EventHandlers about the before and after properties values.

For this reason i am giving here tabular structure of the details below :

** This reference i have taken from the other Microsoft blogs **

Happy coding !!!

SharePoint User Profile Synchronization stuck on Starting

This is the one of the strange issue when you are working with sharepoint.

For me this error occured on of a sudden, last week. It took 2 days to find a resolution for this error.

Finally got the solution today.

I am not able to browse my web application and trying to find the root cause of the issue finally i figured out that User Profile Service synchronization is stuck on starting.

User profile synchronization service stuck on starting as below

Basically sharepoint user profile service is dependent on active directory and lot of other stuff. Managed meta data service is one of them.

When managed metadata service and user profile services run on paralally this will cause a dead lock situation. Because of this Forefront Identity manager service might be disabled as shown below

Solution :

Below are the resolution steps for this issue :

1. Delete the User profile service from CA

Open Central Admin -> Click on Manager Service Applications -> Delete the User profile service

2. Configure and start the managed metadata service

3. Re configure the user profile service

4. Start user profile synchronization service

5. Restart IIS Service

NOTE : Step 2 and 3 are optional if you really using Managed metadata service

Thank you !!

Tuesday, November 6, 2012

Increase session timeout in SharePoint

While working with the sessions in SharePoint we will get session time out exception for some times to over come this we have to increase session time out period of the web application.

This can be done in Central Admin

Follow the below navigation

Open Central Administration -> Application Management -> Manage web application -> Select Your web application -> Click on General Settings -> Here in web page security validation section you can set the session time out period as shown below :

sharepoint SPLongOperation

Usually when you are working with sharepoint, we have to create site programatically or any other operations programatically which will take more time than the usual.

This kind of srenarios rather than depending on the browser processing we can use the sharepoint beauty i.e SPLongRunOperation.

Here is the way to use this.

protected void btnSubmit_Click(object sender, EventArgs e)

     using (SPLongOperation longOperation = new SPLongOperation(this.Page))
         longOperation.LeadingHTML = "";
         longOperation.TrailingHTML = "Please wait your changes are processed";
         string URL = SPContext.Current.Web.Url + "/Pages/OperationDone.aspx";

This will give you a screen like below :

Thank you !!

BDC Service application Business Data Connectivity Service is not accessible SharePoint

Here is the issue working with sharepoint.

he BDC Service application Business Data Connectivity Service is not accessible

Causes for the issue :

There are 2 possible reasons for this issue those are listed below

1. Business Data Connectivity service is not configured properly

2. SharePoint Web Service application is down to access the data

Resolution :

Open Internet Information Manager ( IIS ) and Expand the Sites

Click on SharePoint Web Serves and click on Authentication in IIS section as shown in the below diagram :

And make sure that you should set all the properties as shown in the below image :

Except Annonymous authentication and Widnows authentication rest all should be disabled.

And also follow the instruction given in the other thread after this ( This will also be the other reason for the same issue So, It is mandatory )

Thank you !!!

SharePoint DateTimeControl validation

Here i am explaining how to validate a sharepoint datetime control with required field validator.

Datetime control is a very easy to use but internally it is having a drawback of required validation property.

It has a property called IsRequiredField But it will not work for date format validation when you are working with Visual web parts or web parts.

For this we have to use classical ASP.NET required field validator to validate control

Internally the DateTimeControl of SharePoint is just a calendar dropdown and a text box. Also, they already implemented a simple required field validation by just using the IsRequiredField property.

However, if you try to put an validator (i.e.: CompareValidator, RegularExpressionValidtator, etc…) on it, it says it can’t find the control. This is happening because the DateTimeControl is just a wrapper around this textbox and if you set the Validator ControlToValidate property to the DateTimeControl it isn’t smart enough to know to really validate against the actual textbox

Here is the way you need to define


NOTE : Here ControlToValidate property you need to set as {DateControlID}${DateControlID}Date then only it will work otherwise it will through error

Thank you !!!

Monday, November 5, 2012

this solution contains resources scoped for a web application

This is one more issue you will get when you try to deploy the sharepoint template project.

This is because of the targeted scope and deployment of the application is at Web application level.

Couple of fixes for this in different scenarios :

In Case of Solution Deployment from VS :

Go to Properties of the project by clicking on F4

Change the Change the assembly Deployment Target value to GlobalAssemblyCache / Web Application based on your deployment target.

In Case of Stsadm :

i. If you scoped your solution to WebApplication and deploy the solution in WebApplication level use as below

STSADM -o deploysolution -name SolutionFileName -local

ii. If you scoped your solution to WebApplication and deploy the solution in Globally use as below

STSADM -o deploysolution -name SolutionFileName -url http://servername/ -local

In Case of ECMA Script :

Install-SPSolution -Identity Agilent.ECMS.Rad.CSVPortal.wsp -WebApplication "https://localhost:9000" -GACDeployment 

Thank you !!!