I want to share authority to read content with another system. When contents are published to the public site, we create processing to output the data to the database.

Is there a way to catch only if you include a change in the __Security field?

It was possible to catch the item updated by the item:saved event. I am in trouble because I do not know which field was changed.

1 Answer 1


You can use item:saving event.

You can compare the original and the new item there, e.g.:

private static List<string> FindDifferences(Item newItem, Item originalItem)

    IEnumerable<string> fieldNames = newItem.Fields.Select(f => f.Name);

    return fieldNames
        .Where(fieldName => newItem[fieldName] != originalItem[fieldName])

protected void OnItemSaving(object sender, EventArgs args)
  Item newItem = Event.ExtractParameter(args, 0) as Item;

  if (newItem == null || newItem.Database.DataManager.GetWorkflowInfo(newItem) == null)

  Item originalItem = 
    newItem.Database.GetItem(newItem.ID, newItem.Language, newItem.Version);

  var differences = FindDifferences(newItem, originalItem);

  // your code here

and register

    <event name="item:saving">
      <handler type="My.Assembly.Namespace.MyEventHandler,
        My.Assembly" method="OnItemSaving" />

Please be aware that in some cases saving of the item can be intercepted so not necessarily your changes will be saved.

Long time ago I wrote a blog post about tracking history of item changes https://www.cognifide.com/our-blogs/sitecore/tracking-history-of-item-fields-changes-in-sitecore - I copied code from there.


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.