All About SharePoint

Liedong(Ken) Zheng,SharePoint Leader at SIMPLOT

Archive for June, 2010

item.update vs item.systemupdate

Posted by ken zheng on June 28, 2010

If it was very recent then it most probably means the Item.Update() method has triggered your event.

If it is not a very recent date then it most probably means the Item.SystemUpdate() method has triggered the event.

SystemUpdate method avoids SharePoint 2007 to change modified date and modifier fields. Argument false tells that no new versions are expected. SystemUpdate solved my problem perfectly well.

file.Item.Update() //fails miserably on ItemChanged due to the SPCheckOutStatus.ShortTerm lock.
file.Item.SystemUpdate(false); //This works while the user still has the document open.

Posted in Sharepoint | Leave a Comment »

SharePoint Timer Jobs Running Multiple Times

Posted by ken zheng on June 25, 2010

The problem is the job was running once for each content database!
From there on, fixing the code was simple.. but it may be different for you based on what your timer job needs to do. Remember every Site Collection (SPSite) has a property that gives you the Content Database, and every time a Timer Job is called (targeting a Content Database) the Content Database GUID for which it is running is passed in… use it for validation.
You need to add code to check the ID.

public override void Execute(Guid contentDbId)
{

If (mySiteCollection.ContentDatabase.Id.Equals(contentDbId))
{
… // put your code here and it will only run once for the targeted site collection.
}

}

NB:Try restarting the SharePoint timer service from the command-line using NET STOP SPTIMERV3 followed by a NET START SPTIMERV3. My guess is that the timer service is running with an older version of your .NET assembly. The timer service does not automatically reload assemblies when you upgrade the WSP solution.

Posted in Sharepoint | Leave a Comment »

$common is null or not an object in ajaxtoolkit 3.5

Posted by ken zheng on June 3, 2010

If you just updated your AJAXToolKit dll to 3.5 and found some pages have funny Javascript error like ‘ is null or not an object”.

Go to the source page of aspx, and make sure all the AJAX reference like below:

Posted in AJAX | Tagged: | 3 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 28 other followers