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
1 vote
0 answers
28 views

Does Sitecore.Jobs.JobManager persist job data to the Tasks or EventQueue table within the Core DB?

For Sitecore 9.2 are Jobs persisted within the Core DB or are they simply stored in memory? I have an event handler that executes on publish:end and publish:end:remote to start the Job, but it always ...
user avatar
0 votes
1 answer
91 views

Clearing Sitecore cache on publish for specific items

I want to clear custom cache when items at specific path are published. Here is what I tried so far. Solution 1: I created a custom event handler for publish:itemProcessed and publish:itemProcessed:...
user avatar
  • 153
0 votes
0 answers
99 views

Unable to Save Custom Events With Custom Data In Xdb Collection

We are doing Upgradation from Sitecore 8.2 to Sitecore 9.3. In Sitecore 8.2 We have Custom Events with Custom Values, in 9.3 we cannot use Custom Events with Custom Data directly, will have to Convert ...
user avatar
2 votes
1 answer
227 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 ...
user avatar
0 votes
0 answers
68 views

How to fetch selected version value in programming in Sitecore 9.1.1?

When I will click in the Sitecore client to change versions, I would like to be able to run some code. So, Is there any event when I will select any version number in the Sitecore client? I am sharing ...
user avatar
  • 671
0 votes
1 answer
85 views

How to enable Synchronizing the Index in if(EventDisabler())?

I am adding data in event item:versionAdded and when adding new version then it is calling item:versionAdded event again. For solving this issue I am adding data under: using (new EventDisabler()) { --...
user avatar
  • 671
3 votes
0 answers
139 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 ...
user avatar
1 vote
1 answer
228 views

Making use of the "user" events

I'm using Sitecore 9.1.1, and in the sitecore.config there are a series of user events (user:created, user:created:remote, user:deleted, user:deleted:remote, user:updated, user:updated:remote, etc). ...
user avatar
  • 5,040
2 votes
2 answers
300 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?
user avatar
  • 103
9 votes
2 answers
2k 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 ...
user avatar
2 votes
1 answer
488 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 ...
user avatar
3 votes
1 answer
416 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-...
user avatar
  • 5,040
2 votes
1 answer
163 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 ...
user avatar
1 vote
0 answers
251 views

Sitecore 9.1.1 remote events not executing on CM server

I am trying to get a remote event fired from CD server to CM server and then CM server to create the item required in Sitecore 9.1.1. I can see the event gets added to the database but it never gets ...
user avatar
4 votes
2 answers
347 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 ...
user avatar
  • 599
1 vote
1 answer
53 views

Catching the name of an event that triggered another event

I am using Sitecore 9.1.1 The issue is, I have a custom eventhandler for onPublishEnd where I set the value of a certain field (Ex: Field A) by using BeginEdit() and EndEdit(), which in turn ...
user avatar
1 vote
0 answers
153 views

How to programmatically refresh a Sitecore screen?

I have an Event firing on item:saved, that ends up modifying some fields on the same item being saved. This of course is not immediately reflected on the Sitecore interface, causing a misleading ...
user avatar
1 vote
1 answer
180 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 ...
user avatar
0 votes
1 answer
916 views

Write a file with item field data when item is saved

I want to access all the data of an item when I click Save button in Sitecore. Suppose I have an ITEM A. If I click Save button in Sitecore, I would like to store all the data in the fields to a ...
user avatar
  • 543
4 votes
2 answers
1k 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, ...
user avatar
1 vote
1 answer
137 views

How to preserve the workflow state on closing a custom modal in Sitecore 8.1

My Customer has a regulatory compliance requirement to add secondary authentication prior to any workflow approval, so the approach that I have taken is by defining a custom Action which opens a ...
user avatar
  • 171
5 votes
1 answer
476 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 ...
user avatar
1 vote
0 answers
216 views

$name token not replaced when creating from branch template

Sitecore 9.02 - I have a branch template I've made to create a new page. The template it's based on has a Title field with a standard value set to $name to do the replacement. However, when I create ...
user avatar
  • 5,040
0 votes
1 answer
667 views

Avoid publishing queues / allow concurrent users to publish on Sitecore 8.1

Recently I came across a request from my client that they often get publishing queued. When we are in initial stage we only have few sites any very minimal users who is working on our CM. But ...
user avatar
1 vote
1 answer
544 views

Multiple time custom item:saved event call

I added new patch for item:saved event for media add, edit, update and rename in CDN server. When i am adding new item in media library at that time my custom method OnItemSaved called multiple times ...
user avatar
0 votes
0 answers
165 views

What are ALL the Events triggered when an item is edited?

I have the following code: using (new SecurityDisabler()) { using (new EditContext(itemToChange, false, false)) { itemToChange[field] = theValue; } } the third parameter of ...
user avatar
1 vote
1 answer
450 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 ...
user avatar
9 votes
3 answers
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?
user avatar
2 votes
2 answers
563 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 ...
user avatar
  • 1,949
4 votes
1 answer
698 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?
user avatar
2 votes
1 answer
428 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) { ...
user avatar
4 votes
1 answer
598 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 ...
user avatar
3 votes
1 answer
509 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 ...
user avatar
  • 19.1k
4 votes
1 answer
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, ...
user avatar
0 votes
1 answer
390 views

Using End Edit Silent and Showing Updated Field Values

I have an event processor similar to this. I was originally passing in true for the parameter silent to Item.Editing.EndEdit(bool silent). I figured that this programmatic change wouldn't need to ...
user avatar
  • 2,457
3 votes
1 answer
730 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 ...
user avatar
0 votes
1 answer
2k views

Web indexes not updated upon publish

I am hoping to understand the cause of this and hopefully find a solution - I have looked at every possible solution, but haven't been able to fix it. Sitecore v8.2 update 3 using SOLR. In my ...
user avatar
4 votes
1 answer
701 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 ...
user avatar
2 votes
1 answer
584 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 ...
user avatar
5 votes
3 answers
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 ...
user avatar
  • 273
1 vote
2 answers
691 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
user avatar
  • 273
5 votes
1 answer
123 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 != ...
user avatar
  • 369
10 votes
5 answers
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 ...
user avatar
  • 499
2 votes
2 answers
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?
user avatar
  • 539
2 votes
0 answers
107 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....
user avatar
5 votes
1 answer
781 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 ...
user avatar
0 votes
1 answer
54 views

When to define a new Sitecore event

There are numerous articles describing how to define and register a new Sitecore event: Sitecore Community Docs: Sitecore Events Old SDN (still actual): Using Events Are there any recommendations ...
user avatar
1 vote
1 answer
344 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 ...
user avatar
1 vote
1 answer
572 views

How to trigger custom code when rendering is removed?

I would like to trigger some code when a rendering is removed - actually gone, so not before the change is saved (you never know if an editor changes it's mind after removal and doesn't save). I ...
user avatar
  • 19.1k
3 votes
2 answers
965 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 ...
user avatar
  • 19.1k