Skip to main content
20 votes
Accepted

Why is event data stored in every Sitecore database?

I believe the primary reason is each event has an associated target database. Found a brief explanation here by Kiran Patils on how the event queuing works: The CM instance triggers an event such as ...
Michael West's user avatar
  • 18.2k
17 votes
Accepted

What is the event called when application starts?

Ok - for attaching code to when the application starts, you have a couple of options. Initialize Pipeline The standard way to do this is via the Initialize pipeline. Create yourself a new processor ...
Richard Seal's user avatar
  • 20.5k
15 votes
Accepted

How to get hostname on publish end event

The problem with Sitecore.Context.Site: Sitecore performs publishing on the publisher site, and as you noted, the publish:end is an event and is called without a request, so there isn't even a URL to ...
Zachary Kniebel's user avatar
14 votes
Accepted

Can you run Sitecore Powershell without triggering Sitecore events?

This is how you could use the using statement inside Powershell function Using-Object { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [AllowEmptyString()] [...
Alan Płócieniak's user avatar
14 votes

Can I register an event or goal through an API from Javascript?

Yes you can. In this post http://ggullentops.blogspot.be/2016/02/integrating-addthis-with-sitecore-goals.html I described how you can trigger a goal from AddThis (so actually using javascript to call ...
Gatogordo's user avatar
  • 20.2k
13 votes
Accepted

How can I write my own custom disabler?

Sitecore's built in disablers, like the SecurityDisabler and the EventsDisabler classes, all inherit the Sitecore-provided Switcher class. This class is an IDisposable that can be used to create ...
Zachary Kniebel's user avatar
10 votes
Accepted

Can I register an event or goal through an API from Javascript?

There are two ways to register goals from JavaScript that I am aware of: Federated Experience Manager Sitecore FXM allows you to make visits and trigger events from external websites. There's an ...
Dmytro Shevchenko's user avatar
9 votes
Accepted

"Silently" Create Item - Create Item Without Triggering Indexing or other Events

If you decompile and have a look at the Sitecore.Data.Items.ItemEditing class, in Sitecore.Kernel, you will find that all the EndEdit(bool) method does (and the relevant parts of its overload methods ...
Zachary Kniebel's user avatar
9 votes

Can you run Sitecore Powershell without triggering Sitecore events?

Wrapping your code in a BulkUpdateContext block as mentioned in the Powershell GitBook will make the tasks more performant and also silence any events or tasks. Import-Function -Name New-UsingBlock ...
Christian Hagelid's user avatar
9 votes
Accepted

Pipelines vs Event Handlers

Pipeline To me pipelines are about process. Do this, then this. Allowing you to insert and remove processes simply with patch configs. A great example of this is login user pipeline. Your pipeline ...
Chris Auer's user avatar
  • 13.1k
9 votes
Accepted

How to raise an event in Sitecore 9+

In Sitecore 9 the event model has changed somewhat and events are now queued within each DB (master, core, web etc). This is partially correct. You could always queue remote events in your Sitecore ...
jrap's user avatar
  • 4,951
8 votes

Why is event data stored in every Sitecore database?

Answer All databases have an [EventQueue] in order to help spread out responsibilities and reduce the load on a particular database. Explanation The [EventQueue] table exists as a means of ...
jrap's user avatar
  • 4,951
7 votes

Restricting Item Access Rights to Roles - Prevent Users from being assigned Access Rights directly

Because Sitecore does not provide you the hooks to validate the transaction you're after, your best bet is to hide the security features and manage them in code. Here's a few suggestions that aren't ...
sitecorerick's user avatar
  • 2,329
7 votes
Accepted

When is it safe to remove an `EventQueue` record?

After having processed an event from the queue each instance updates the associated last processing timestamp (LPT) which is stored in the Properties table and has the key in the following format '...
Alexander Mogilka's user avatar
7 votes
Accepted

Can a server subscribe to its own remote events?

The event queue table has two columns related to the matter. They are RaiseGlobally (true by default) and RaiseLocally (false by default). These flags control the event execution appropriately (i.e. ...
Andrey Bobrov's user avatar
7 votes

How to add custom code on workflow state change?

There's no pipeline or event that you can plug into in the general sense of Sitecore's pipelines and events that you see in the ShowConfig. Instead, it's driven by an Item based pipeline provider. ...
Pete Navarra's user avatar
  • 14.7k
6 votes

When is it safe to remove an `EventQueue` record?

In order to be 100% sure that a particular event was processed by all servers, you would need to write a rather complex query. To illustrate, I've written a query to return all events processed by a ...
jrap's user avatar
  • 4,951
6 votes
Accepted

How to run custom logic when a user has been added to a particular role?

You can do this using Sitecore's eventing engine, by creating event handlers for the roles:usersAdded event, the roles:usersAdded:remote event, or both. The roles:usersAdded event is raised when ...
Zachary Kniebel's user avatar
6 votes

When to use item:Created vs Item:Saved

The item:created event will come too soon as the fields will not be populated yet (as you have noticed). The item:saved event will do the trick, but created overhead as it is called on every save (so ...
Gatogordo's user avatar
  • 20.2k
5 votes
Accepted

SiteDefinition Config Events - Site Changed to MyCompanyName

This works because of the way that HtmlCacheClear processes the <sites> list. When you take a peek into the code for HtmlCacheClearer.ClearCache() method, you'll see that it's iterating through ...
Pete Navarra's user avatar
  • 14.7k
5 votes
Accepted

Get indexed items after index update

When an item is updated in the index, the indexing:updateditem event is raised with the index name and item ID as parameters. You could add a handler for this event and either clear the cache based on ...
Kasaku's user avatar
  • 4,174
5 votes
Accepted

Execute custom logic whenever an item is added from a particular branch template

There are actually a few options here: Command Templates Event handlers (item:added) Pipeline processors (uiAddFromTemplate, addFromTemplate) Command Templates This is by far the simplest solution, ...
Zachary Kniebel's user avatar
5 votes

Is it possible to associate goal triggering on button click without code?

No. You can only associate goals to items. Described here: Associate a goal with an item But I would add; you're likely also thinking about this wrong. The goal you have, is not "the user presses ...
Mark Cassidy's user avatar
  • 25.3k
5 votes

Is it possible to associate goal triggering on button click without code?

Honestly I was looking into this myself too. And whereas Mark says that this is not possible that is (for as far as I am aware) still true. However, I don't agree that you should look whether or not ...
Kris Verheire's user avatar
5 votes
Accepted

Error while publishing when items are moved in SXA based website

This is a known bug. You should contact Support to get the patch (you can use reference number 13144). The reason is that in the OnItemMoving function in the VirtualMediaFolderValidator class from ...
Gatogordo's user avatar
  • 20.2k
5 votes

Pipelines vs Event Handlers

To add to @Chris Auer, think of it this way: What is the difference An event is a reaction to something happening in the system. This could be a user interaction, like item:saved, item:created, etc, ...
Richard Seal's user avatar
  • 20.5k
5 votes

In which project should we override item:publish event

Answer In your specific use case, Publishing is the Sitecore function that you are interested in. Therefore, I would create a Helix Module called Foundation.Publishing on the Foundation Level, and ...
Pete Navarra's user avatar
  • 14.7k
4 votes
Accepted

How does the Sitecore event queue work?

I agree that this is many questions in one. As a start though this is from the Sitecore 6.3 PDF: Event Queues To ensure data and cache coherence and support communication between instances in an ...
Adam Seabridge's user avatar
4 votes
Accepted

Detecting when an item being saved is during package installation

If you only want to run your custom logic when the user saves an item from within the Sitecore client, you could use a saveUI pipeline processor instead. This would eliminate the need to check for ...
Ben Golden's user avatar
  • 3,313
4 votes

Detecting when an item being saved is during package installation

You can achieve this with Sitecore.Context.Job.Name During installation it will return: "Install" During normal item saving action Sitecore.Context.Jobproperty will be null
Alan Płócieniak's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible