Tuesday 15 April 2014

sharepoint - how to temporarily disable email notification while updating items in code? -


While updating the item, I'm having trouble with a temporarily disabled email notification, so that the system can send unnecessary emails. The one I am trying to accomplish is to disable the alert, update items, then alert again

SPList agenda = web. List ["work"];

tasklist.EnableAssignToEmail = false; // This property disables mail

tasklist.Update ();

// Update all here

items ["title"] = "new title"; Item.update ();

tasklist.EnableAssignToEmail = True; // Enable email notifications

tasklist.Update ();

As soon as I enable the alert, the changes made in the middle of the code still stop the warning and send the email.
Is anyone better idea to solve this? Thank you.

Is using an SPListItem to turn off alert instead?


No comments:

Post a Comment