Thursday, September 26, 2013

SharePoint DateTime control not loading for some user (DateTimeControl Access denied )

It is a permission issue.
DateTimeControl field uses the iframe calender page to render the actual calender. The location of iframe.aspx is C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS
The problem appeared to be with managed paths in the site collections, the Users with "Contribute access" were accessing the following path:
http://myserver/_layouts/iframe.aspx (Path to Root site collection where user doesn't have access)
The solution:

Wednesday, September 25, 2013

Why to Dispose SPSite and SPWeb objects in SharePoint?

Several of the SharePoint Foundation objects, primarily the SPSite class and SPWeb class objects, are created as managed objects. However, these objects use unmanaged code and memory to perform the majority of their work. The managed part of the object is much smaller than the unmanaged part. Because the smaller managed part does not put memory pressure on the garbage collector, the garbage collector does not release the object from memory in a timely manner. The object's use of a large amount of unmanaged memory can cause some of the unusual behaviors described earlier. Calling applications that work with IDisposable objects in SharePoint Foundation must dispose the objects when the applications finish using them. You should not rely on the garbage collector to release them from memory automatically.

Simple PowerShell to get Event Receivers attached to SharePoint list

$spWeb = Get-SPWeb -Identity "SiteUrl"

$spList = $spWeb.Lists["ListName"] 

$spList.EventReceivers | Select Name, Assembly, Type

SharePoint document metadata not updating

I faced a weird issue today, Metadata for document which has lookup column was not updating even after saving the item. There was no erro...