Questions tagged [events]

For questions related to the Sitecore Event system. This includes the Event Queue, event handling, custom events.

Filter by
Sorted by
Tagged with
27
votes
2answers
811 views

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

Best practice is to assign access rights to roles rather than users. So I would like to block changes that apply access rights for users. Sitecore does not seem to trigger the saveUI pipeline on ...
18
votes
2answers
2k views

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

I have found that I can assign a goal or a page event to get triggered when a user hits a given page. So, we have a thank you page a user is redirected to after submitting a form and that ...
16
votes
1answer
6k views

How does the Sitecore event queue work? [closed]

There's an EventQueue table in every Sitecore database. It contains both the local and remote events of Sitecore instances. I would like to know how the event queue works, exactly. Why are some ...
12
votes
2answers
1k views

Why is event data stored in every Sitecore database?

A table named EventQueue is present in every Sitecore database. It seems to contain local and remote events of Sitecore instances. Why are some of these events stored in the Core, some in the Master, ...
11
votes
2answers
903 views

Can you run Sitecore Powershell without triggering Sitecore events?

I want to write a script which could potentially clean up a load of unused assets, but I would like it not to trigger events (index rebuilds etc). Is there a way to say "do this silently" in a ...
11
votes
3answers
1k views

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

Sitecore stores its events in a database table called EventQueue. It is used for centralized event-based communication between Sitecore instances. Sometimes this table grows quite large and it needs ...
11
votes
1answer
307 views

How can I write my own custom disabler?

Sitecore ships with a bunch of disablers, like the SecurityDisabler and the EventsDisabler, but what if I want to write my own? I have a bunch of item:saved event handlers that run but when I add a ...
10
votes
5answers
2k views

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

In sitecore DMS is there any way to associate goal triggering on button click without code , i read some blogs which are giving info regarding how to associate item or pdf to trigger goal . So is it ...
10
votes
3answers
1k views

Detecting when an item being saved is during package installation

I have a custom item:saving event handler which contains some specific logic when a user user makes a change to an item. This works fine but when we create a content package from a different ...
9
votes
3answers
2k views

Pipelines vs Event Handlers

What is the difference between Sitecore Pipelines and a Sitecore Event Handlers for a specific event? When should we customise a pipeline and when should we add a new handler?
9
votes
2answers
979 views

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). Edit: turns out I was a bit wrong here. Sitecore has for some time had the ability ...
8
votes
1answer
1k views

“Could not create instance of type: Sitecore.Data.SqlServer.SqlServerIDTable. No matching constructor was found” exceptions on Alarm clock event

My UAT logs are filled with the below logs. Could you please direct which area I should start looking to debug this issue. WARN Could not find constructor in ReflectionUtil.CreateObject: Sitecore....
7
votes
2answers
106 views

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

In Sitecore, is there a way that I can run custom logic when a user is added to a particular role?
7
votes
2answers
961 views

after upgrade from 6.5 to 7.2 Item.Editing.EndEdit() no longer fires event

We have a solution that was upgraded from 6.5 to 7.2. After this upgrade we are having issues where Item.Editing.EndEdit() no longer triggers item:saving/item:saved events. Therefore changes made to ...
6
votes
1answer
910 views

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

I am looking to run some custom logic (likely some rules) whenever an item is added from a particular branch template. How can I trigger this logic to run, in Sitecore.
5
votes
3answers
3k views

When to use item:Created vs Item:Saved

I have a scenario where I need to modify a certain value of an item when it is created (not saved) off a particular template. In order to do that I tapped into the item:created event, however I ...
5
votes
1answer
707 views

Can a server subscribe to its own remote events?

I am creating a custom event to allow CD to inform CM about a specific user action in a production environment. My local development environment is a single server. Despite subscribing to the remote ...
5
votes
1answer
114 views

SitecoreItem.Visualization.Layout throws exception

I created a new screen in sitecore and added a button. On clicking of this button I am calling a method. Everything works fine except following piece of code. if (sitecoreItem.Visualization.Layout != ...
5
votes
1answer
369 views

Sitecore multiple CD web databases publishing/indexing EventQueue database name

Say I have a single CM with 1x master db, 1x core db and 2x web dbs (2x publishing targets) for 2x CD servers in different regions. I can't call both web dbs "web" - one must be something ...
4
votes
2answers
836 views

How to get hostname on publish end event

I am trying to get "http://hostname" in below way. string.Concat(Request.Url.Scheme, Uri.SchemeDelimiter, Request.Url.Host) this should work in normal cases, but i am doing this on publish:end event,...
4
votes
1answer
533 views

How to add custom code on workflow state change?

Is there a pipeline / event available which I can plug into to execute custom code when workflow state changes for any item?
4
votes
2answers
832 views

“Silently” Create Item - Create Item Without Triggering Indexing or other Events

I know that when I edit items, I can pass true to the EndEdit method to save the item without triggering events/indexing on save. Since I almost always want to edit an item after creating it, it seems ...
4
votes
2answers
549 views

Get indexed items after index update

We are using some (custom) caches that get cleared when data changes in Sitecore - it's written so that it only clears the cache when items from a certain template are published (we don't want this ...
4
votes
1answer
467 views

How to get PageViewEvents from Interaction

I am getting a little bit confused getting events from facets in sitecore 9.0.1. As I understand there are two different Facet and Event class definitions. The Sitecore.XConnect version and the ...
4
votes
1answer
288 views

How to get a front-end event to show up in Path Analyzer?

We're using Angular to handle site's front-end, and I'd like to add some events which happen there, like opening "new" pages based on JavaScript to Path Analyzer. This is how I tried to do it: var ...
4
votes
2answers
192 views

How to catch field reset in item:saving event

I want to make a item:saving pipeline processor that will perform some operations when a item field is reset. I thought this would be simple, but it turned out to be trickier than I thought. Maybe I'm ...
4
votes
1answer
1k views

Prevent Item Duplication in Sitecore

I want to prevent user from creating item with duplicate name. I've referenced Sitecore Climber's Prevent Duplicates approach with slight modification to prevent item duplication due to rename, copy, ...
4
votes
1answer
608 views

Sitecore parallel publishing locks up Content Delivery server

The original blog post on parallel publishing by Alex Shyba for SC 7.2 is a great resource and I think still applies to Sitecore 8.2. I've dabbled with parallel publishing before on SC7.2 as well as ...
4
votes
2answers
684 views

Couldn't trigger custom event handler or Processor in Sitecore Publishing Service? [closed]

I have a requirement to invalidate the file in cdn cache on completion of sitecore item publishing. To achieve this I have created custom processor and patched into "publishEndResultBatch" pipeline, ...
3
votes
1answer
546 views

Manipulate item name on create

We are using out of the box item name functionality in Sitecore. We are also using $name to add that to the title of the page. Our client would like to have the following happen. They would like to ...
3
votes
1answer
423 views

Publish:complete not fired when publishing through code

We have added an event to publish:complete and it is working fine when we publish in Sitecore (manually). However, when we do the exact same publish in code the event is not fired. The code: var ...
3
votes
1answer
596 views

While deleting an item in item:created event i got exception

I am running on Sitecore 8.2 rev. 170728 with SXA 1.5 I have a requirement where we need to limit sub-items for an item. To implement it, I have created custom event handler that check the limit and ...
3
votes
1answer
59 views

What is the purpose of storing local events in the `EventQueue`?

In Sitecore databases, the EventQueue table contains both local and remote events of Sitecore instances. Why is there a need to track local events? Can't they just be handled internally in the ...
3
votes
2answers
827 views

Change datasource in final layout through API

I am trying to add some code (after an item is created - but that is not relevant) that manipulates the layout fields. To be precise, I want to change the datasource of some renderings (based on a few ...
3
votes
0answers
92 views

How does Sitecore determine which EventQueue database to use for a given event and how to change it

Sitecore 8.2 I have a CM and 2 CDs like so: ___ CD1 (web1, core) CM (master, core, web1, web2) ____/ \___ CD2 (web2, core2) Note ...
2
votes
2answers
2k views

What is the event called when application starts?

I am trying to attach a handler/code when the Sitecore web application instance is starting up. What event is triggered when the application instance starts?
2
votes
2answers
427 views

Error while publishing when items are moved in SXA based website

SXA v1.7.1 with Sitecore v9.0.2 I'm regularly getting this error in Sitecore when trying to publish after I have restructured some items in master database. If I delete the modified sub-tree from web ...
2
votes
1answer
117 views

In which project should we override item:publish event

I am very new to helix principles. I have created the project structure following sample habitat project. My requirement is to call an external api when any item ( of a specific template) is ...
2
votes
1answer
82 views

Run Powershell script when an Item is being published

I'm trying to do implement some logic while a particular template item is getting published. To implement this logic I started exploring the Sitecore Powershell's Event Handlers. For the events like ...
2
votes
2answers
941 views

Sitecore Context at Event Method

I have an Sitecore (v8.1) Event and method that processing this event but Sitecore.Context is not available. I am try to use call SiteContextSwitcher but it does't help. SiteContext siteContext = ...
2
votes
1answer
512 views

Getting workflow comments during item saved event handling

Classic use case. We have "Authors" and "Approvers" roles in our setup. When an item has transitioned from Draft to Review state, we're sending an email notification to a list of "Approvers" to ...
2
votes
2answers
164 views

Can someone explain more about Events in Sitecore?

When would I use or create events under the marketing control panel? Also, what is the difference in the marketing control panel events and the ones found under Analyze > Attributes > Events?
2
votes
1answer
175 views

Sync a single bucketed item to change its path

I've written a custom bucket action to set the path based on a template date field, rather than the created date. I based this information off this blog: http://techitpro.com/uncategorized/sitecore-...
2
votes
1answer
166 views

How to clear HtmlCache on a CD server from an admin page

How would I go about creating an admin page to clear the cache on a CD server? Looking at this question/answer I would assume the following: Define a new cache:clear custom event in a new config ...
2
votes
1answer
315 views

Updating Media Item Stream on Item:Saved Event

I had implemented a item:saved event handler that updates the MediaStream of a MediaItem. The code is roughly like this: public void OnItemSaved(object sender, EventArgs args) { ...
2
votes
0answers
103 views

Accessing Database Items in a Timer

We are experiencing some problems when accessing items using a Timer which is not consistent for all items. We have the following code: var database =Sitecore.Configuration.Factory....
1
vote
1answer
311 views

Copy field from parent item on creation

I know that I can reference a parent item with Glass Mapper, but I need to copy a specific field on my child because I need to facet on it. What is the best way to copy a field from my parent item on ...
1
vote
1answer
125 views

Item Created Event for Web database and send email

I have a requirement to send a email to subscribers once a blog will be available publicly. Requirement is very specific that email will be send only one time when item is created, not on update or ...
1
vote
1answer
325 views

How to add renderings programmatically when another rendering is added

Which pipeline should I use when a new rendering is added in the presentation? I have a scenario to add renderings programmatically if a particular rendering is added in the item. I will write a ...
1
vote
2answers
606 views

Sitecore item:created fields coming up empty

I am writing a item:created event. I need to update one of these values, however the .Fields collection comes up empty