Skip to content

Instantly share code, notes, and snippets.

@alexshyba
Created July 30, 2013 20:56
Show Gist options
  • Save alexshyba/6116855 to your computer and use it in GitHub Desktop.
Save alexshyba/6116855 to your computer and use it in GitHub Desktop.
Subscribing to item:saved where you can access item changes and do lots of efficient exclusion.
Event.Subscribe("item:saved", this.Item_Saved);
private void Item_Saved([NotNull] object sender, [NotNull] EventArgs e)
{
var changes = Event.ExtractParameter<ItemChanges>(e, 1);
if (!changes.IsFieldModified(FieldIDs.Security) && !changes.IsFieldModified(FieldIDs.Workflow) &&
!changes.IsFieldModified(FieldIDs.WorkflowState))
{
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment