Sitecore - creating a new OnSavingItem event element redirects the shell to the newly created element

There is an annoying problem.

When a user edits a field for an item, we use the OnSavingItem event handler to create any new items elsewhere in the background.

The problem is that the user edited the field, which redirects to the element that we are invisible, created in the background.

We want him to stay where he is ... Any ideas?

thank

+3
source share
4 answers

If you want to disable the transfer of the item you just created, you can also consider applying the following code:

// Before we copy the item we put notifications on to make sure we won't be transfered to the newly created item                        
Sitecore.Client.Site.Notifications.Disabled = true;

// Your action comes here

Sitecore.Client.Site.Notifications.Disabled = false;
+3

<event name="item:saved">

Handler? , , , , .

0

SiteCore... John West

, : saveUI. , , API, , , .

.

John West Sitecore

0

: saved is much heavier than the processor in the saveUI pipeline. For example, the element: is saved during publication, which is not what you really want. I always recommend handling such settings both at the pipeline level and at the working level.

0
source

Source: https://habr.com/ru/post/1768987/


All Articles