Skip to main content
Add syntax highlighting hints.
Source Link
Corey Smith
  • 2.7k
  • 1
  • 22
  • 45

Have you considered hooking into item:saving Sitecore event? You can retrieve an item being saved and sanitize its fields:

public void OnItemSaving(object sender, System.EventArgs args)
{
    Item item = Event.ExtractParameter(args, 0) as Item;
    Error.AssertNotNull(item, "No item in parameters");
    //modify item fields as required
}
public void OnItemSaving(object sender, System.EventArgs args)
{
    Item item = Event.ExtractParameter(args, 0) as Item;
    Error.AssertNotNull(item, "No item in parameters");
    //modify item fields as required
}

More info in John West's post: https://community.sitecore.net/technical_blogs/b/sitecorejohn_blog/posts/repost-intercepting-item-updates-with-sitecore

Have you considered hooking into item:saving Sitecore event? You can retrieve an item being saved and sanitize its fields:

public void OnItemSaving(object sender, System.EventArgs args)
{
    Item item = Event.ExtractParameter(args, 0) as Item;
    Error.AssertNotNull(item, "No item in parameters");
    //modify item fields as required
}

More info in John West's post: https://community.sitecore.net/technical_blogs/b/sitecorejohn_blog/posts/repost-intercepting-item-updates-with-sitecore

Have you considered hooking into item:saving Sitecore event? You can retrieve an item being saved and sanitize its fields:

public void OnItemSaving(object sender, System.EventArgs args)
{
    Item item = Event.ExtractParameter(args, 0) as Item;
    Error.AssertNotNull(item, "No item in parameters");
    //modify item fields as required
}

More info in John West's post: https://community.sitecore.net/technical_blogs/b/sitecorejohn_blog/posts/repost-intercepting-item-updates-with-sitecore

Source Link
grg
  • 1.8k
  • 9
  • 16

Have you considered hooking into item:saving Sitecore event? You can retrieve an item being saved and sanitize its fields:

public void OnItemSaving(object sender, System.EventArgs args)
{
    Item item = Event.ExtractParameter(args, 0) as Item;
    Error.AssertNotNull(item, "No item in parameters");
    //modify item fields as required
}

More info in John West's post: https://community.sitecore.net/technical_blogs/b/sitecorejohn_blog/posts/repost-intercepting-item-updates-with-sitecore