Programmatically Read Alerts for Users in Site Collection

SPAlerCollection class can be used to get the Alert Collection for the User.

The below code snippet is used to read all alerts registered for the site collection users.

private static void GetAlerts()

{

SPSite currSite = new SPSite(“http://uday”);

SPWeb currWeb = currSite.OpenWeb();

SPUserCollection […]

How to set the Interval for Alerts in SharePoint 2007

To set the timer job interval for alerts can set by using the setproperty for the property job-immediate-alerts command in stsadm.

Syntax:STSADM -o getproperty -pn job-immediate-alerts –pv <property value> -url <URL of the Site>

Example:STSADM -o getproperty -pn job-immediate-alerts –pv “every 2 minutes” -url http://uday

[…]

How to Edit InfoPath XML File in Forum Library Programmatically in SharePoint 2007

The below lines of code snippet is to update the infopath xml record(file)

SPWeb _web = SPContext.Current.Web; SPList _list = _web.Lists[“SampleFormLib”];

MemoryStream myInStream = new MemoryStream(item.File.OpenBinary()); XmlTextReader reader = new XmlTextReader(myInStream);

XmlDocument doc = new XmlDocument(); doc.Load(reader);

reader.Close(); myInStream.Close();

XmlNamespaceManager nameSpaceManager = new XmlNamespaceManager(doc.NameTable); nameSpaceManager.AddNamespace(“my”, “http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-06-11T12:44:57“);

doc.DocumentElement.SelectSingleNode(“my:Status”, nameSpaceManager).InnerText = “Saved”; […]

Get Timer Job Interval for Alerts

To get the timer job interval for alerts can be retrieved by using the getproperty command in stsadm.

Syntax:STSADM -o getproperty -pn job-immediate-alerts -url <URL of the Site>

Example:

STSADM -o getproperty -pn job-immediate-alerts -url http://uday

Set Duration for New Icon Indicator in SharePoint

To Set the Duration for New icon in SharePoint (the indicator which shows next to new items) access the SharePoint WebApplication object and set the value for DaysToShowNewIndicator.

SPWebApplication WebApp = SPWebApplication.Lookup(new Uri(WebAppURL.Text));

WebApp.DaysToShowNewIndicator = 3;

WebApp.Update();

[…]

Approval Workflow goes to Infinite Loop while Editing

In SharePoint Out of the Box Approval workflow for content approval has issue while triggering workflow when the item is changed, the status will remain on “InProgress” or “Pending” even though the item is approved.

Microsoft has released the hotfix for this issue. It can be downloaded from here

Site Content Type in Use – Error while Deleting Content Type

If you get “Site Content Type in Use” error while deleting the content type.

Change the default content type for the list/library, which uses this content type.

Then try to delete the content type.

“The file has been modified by SHAREPOINT\system” Error while Updating InfoPath xml file in SharePoint Library

If you try to update the InfoPath xml file through object model in events/WebParts or through any medium.

While execting the Item.Update() will cause the below error. While updating the InfoPath xml file in ListItem the file and ListItem object getting disconnected.

Item.File.Update() will solve your issue.

StackTrace […]

CTP of Visual Studio 2008 extensions for SharePoint v1.3

MS Released the CTP of Visual Studio 2008 Extensions for sharepoint.

The Community Technology Preview (CTP) release is available here on Microsoft Connect where customers can also report any feedback they have. It is anticipated that all existing VSeWSS 1.2 projects will work with the CTP. The CTP is not supported by Microsoft Customer Support […]

HTTP 401 Not Found web service error while publishing SSRS Report to SharePoint

If you are getting “HTTP 401 Not Found web service error” while publishing your SSRS report in SharePoint Library. Please refer your integration settings in Central Administration and verify the user permission from the login where you are trying to publish the report to SharePoint Library.