0

I copy folders and documents to a document library by code through a feature. I am trying to prevent alerts from being fired when the document library is populated.

I tried setting the Filter property as follow :

newAlert.Filter = string.Format("<Query><Neq><FieldRef Name=\"Author\"/><Value type=\"string\">{0}</Value></Neq></Query>", "SHAREPOINT\\system");

But it doesn't work , alerts keep on being triggered.

Thanks for any help.

  • Your caml query seems not correct. Recheck it via googling. As Author field will be of type Person and It should be CreatedBy maybe! – ateet Oct 17 '14 at 10:55
  • The correct way of filtering on user Column is : newAlert.Filter = "<Query><Neq><FieldRef Name=\"Author/New\" /><Value type=\"Text\">" + userFilter + "</Value></Neq></Query>"; – esbeone Oct 20 '14 at 12:44
0

The correct way of filtering on user Column is :

newAlert.Filter = "<Query><Neq><FieldRef Name=\"Author/New\" /><Value type=\"Text\">" + userFilter + "</Value></Neq></Query>"

where userFilter if the loginname

0

Have you tried Make a console application with the following code to Disable/Enable alerts on a SharePoint 2010/2007 list/Library?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.