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
2answers
60 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?
8
votes
2answers
223 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
66 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
32 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
53 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
98 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
81 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
39 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
74 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
89 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
126 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
263 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
66 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
242 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 different, e....
1
vote
0answers
130 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
226 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
285 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
54 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
216 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
2answers
1k 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
302 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
361 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
206 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
330 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
273 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
617 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
233 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
361 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
1k 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
428 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
422 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 ...
4
votes
3answers
2k 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
472 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
102 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 != ...
2
votes
3answers
1k 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
87 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
581 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
47 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
267 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
449 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
564 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
663 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,...
0
votes
1answer
478 views

Is there a way to find out what caused an `item:created` event?

I wrote a custom item:created event handler that creates an item of template B whenever an item of template A is created. It works well, except for the cases when the parent folder is being duplicated—...
2
votes
2answers
646 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 = ...
3
votes
1answer
463 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 ...
0
votes
1answer
108 views

SiteDefinition Config Events - Site Changed to MyCompanyName

I noticed a strange difference between our Production and QA Sitecore websites that was deliberately done by our Sitecore vendor. In the SiteDefinition.config file, the site block is changed to ...
4
votes
1answer
256 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 ...
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....
3
votes
2answers
584 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 ...
11
votes
2answers
611 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 ...