Home > SharePoint, spchange > SPChange – Get the SharePoint changes

SPChange – Get the SharePoint changes


You could use the SPChange class to get the changes which have occured at SPList, SPWeb, SPSite, or SPContentDatabase level.

Use the GetChanges method of the SPList, SPWeb, SPSite, or SPContentDatabase object to return a SPChangeCollection object with the changes that have occurred within a given scope. You can then enumerate the collection and examine each of its members individually.

SPSite site = SPContext.Current.Site;
SPWeb web = site.OpenWeb();

SPChangeQuery query = new SPChangeQuery(true, true);
SPChangeCollection changes = web.GetChanges(query);

foreach (SPChange spChangedObject in changes)
{
SPChangeItem changedItem = (SPChangeItem)spChangedObject;
// work with spChangedItem here
}
Advertisements
Categories: SharePoint, spchange
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: