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
0
votes
0answers
33 views

How to get info about parent event

I've subscribed to item:deleted event for child item and added such code var load = $"item:load(id={parent.ID})"; Sitecore.Context.ClientPage.ClientResponse.Timer(load, 3); If I delete ...
2
votes
1answer
64 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 ...
0
votes
0answers
59 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 ...
0
votes
1answer
36 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()) { --...
0
votes
0answers
31 views

Detect when Sitecore automatically clears a custom cache

I'm trying to trigger something in the event that Sitecore clears one of my custom caches (implementing Sitecore.Caching.CustomCache) when it gets full. I can monitor the cache size compared to its ...
3
votes
0answers
91 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 ...
1
vote
1answer
106 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). ...
2
votes
2answers
147 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?
9
votes
2answers
918 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 ...
2
votes
1answer
137 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
165 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
108 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 ...
1
vote
0answers
176 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 ...
4
votes
2answers
178 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 ...
1
vote
1answer
46 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 ...
1
vote
0answers
102 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 ...
1
vote
1answer
120 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 ...
0
votes
1answer
334 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 ...
4
votes
2answers
639 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, ...
1
vote
1answer
101 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 ...
5
votes
1answer
364 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 ...
1
vote
0answers
181 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 ...
0
votes
1answer
493 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 ...
1
vote
1answer
422 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 ...
0
votes
0answers
95 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 ...
1
vote
1answer
318 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 ...
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?
2
votes
2answers
409 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 ...
4
votes
1answer
514 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?
2
votes
1answer
306 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) { ...
4
votes
1answer
447 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 ...
3
votes
1answer
412 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 ...
4
votes
1answer
984 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, ...
0
votes
1answer
318 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 ...
3
votes
1answer
563 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 ...
0
votes
1answer
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 ...
4
votes
1answer
589 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 ...
2
votes
1answer
499 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 ...
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 ...
1
vote
2answers
586 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
5
votes
1answer
113 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 != ...
10
votes
5answers
1k 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 ...
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
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....
5
votes
1answer
696 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 ...
0
votes
1answer
52 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 ...
1
vote
1answer
309 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
523 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 ...
3
votes
2answers
812 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 ...
4
votes
2answers
819 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,...