Make Sitecore record the class writing to the logs

I’m a big fan of writing into your logs the class and method that is currently executing – it makes fault finding so much easier. Typically I’d do this with reflection – but it turns out that you can do this with a small change to Sitecore’s configurationContinue reading “Make Sitecore record the class writing to the logs”

Advertisements
Make Sitecore record the class writing to the logs

How DisableEventFiring / EventFiringEnabled works

I’ve got an event handler on a SharePoint list that’s fairly long running, and this then raised a question in the office – do these settings control event firing for the currently running event handler, or for the entire list?

Very often you see lines of code like this…

this.EventFiringEnabled = false;
item.Update();
this.EventFiringEnabled = true;

… but was this really necessary? Are people worried about events not being handled ‘cos firing is disabled, or is this just a convenient way of tracking whether events are enabled or not? Continue reading “How DisableEventFiring / EventFiringEnabled works”

How DisableEventFiring / EventFiringEnabled works