Friday, January 28, 2011

Enable My Links in Sharepoint 2010

As I came accross with this problem when I got a small requirement as how to enable My links in Sharepoint 2010 as just like sharepoint 2007. Below is the steps to enable that.

  1. In Central Administration, click Manage Service Applications.
  2. Click the User Profile Service Application.
  3. Click Configure Personalization Site.
  4. Click New Link.
it will asked for the URL enter the link as given below

http://yourservername/my/_layouts/MyQuickLink.aspx

and thats it you can see My link in

System Account->My Site-> My Links



Thanks

Afroz Shaikh

Thursday, January 20, 2011

Access Denied SPPersistedObject.Update()

Firstly whenever you get Access denied error while you Updating SPPersistedObject then overide method in your Class like below

protected override bool HasAdditionalUpdateAccess()
{

return true;

}

then you will get exact error of access denied then apply below given steps.

Give Excecute permission to "WSS_Content_Application_Pools" .





below given procedure Name are

Permission Stored Procedure Database Role
EXECUTE proc_putObject WSS_Content_Application_Pools
EXECUTE proc_putClass WSS_Content_Application_Pools
EXECUTE proc_dropObject WSS_Content_Application_Pools
EXECUTE proc_getNewObjects WSS_Content_Application_Pools

The EXECUTE permission was denied on the object 'proc_putObject', database 'SharePoint_Config', schema 'dbo'

Solution:

Fisrtly whenever you get Access denied error while you Updating SPPersisted Object then overide method in your sppersisted object like below

protected override bool HasAdditionalUpdateAccess()
{

return true;

}

then you will get exact error of access denied then apply below given steps.

Give Excecute permission to "WSS_Content_Application_Pools" .





below given procedure Name are

Permission Stored Procedure Database Role
EXECUTE proc_putObject WSS_Content_Application_Pools
EXECUTE proc_putClass WSS_Content_Application_Pools
EXECUTE proc_dropObject WSS_Content_Application_Pools
EXECUTE proc_getNewObjects WSS_Content_Application_Pools

Monday, January 3, 2011

creating Folders within SharePoint List Programmatically

using (SPSite sSite = new SPSite("http://yourservername"))
{
using (SPWeb sWeb = sSite.OpenWeb())
{
SPUser sUser = sWeb.SiteUsers["domainname
\\username"];
SPAlert sListAlert =
sUser .Alerts.Add();

//Define the type of object
sListAlert.AlertType = SPAlertType.List;
// the List or Document Library to which alert is applied
sListAlert.List = sWeb.Lists["List_Name"];
//Define the Event type
sListAlert.EventType = SPEventType.All;
//Set time interval for sending alert.
sListAlert.AlertFrequency = SPAlertFrequency.Immediate;

//Pass true to Update method will send confirmation mail
sListAlert.Update(false);

//Dispose objects
sListAlert = null;
sUser = null;
}
}