Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ulf Möllerström 71 posts 248 karma points
    Apr 18, 2023 @ 15:08
    Ulf Möllerström
    0

    OnTrashing CancelOperation messages not working

    Hi guys!

    Trying to update functionality in v. 8.11, and having problems with displaying cancellation message...

        private static void OnTrashing(IContentService sender, MoveEventArgs<IContent> e)
        {
            var content = e.MoveInfoCollection.FirstOrDefault()?.Entity;
            if (content is null) return;
    
            if (!e.CanCancel || !content.Published) return;
    
            e.Messages.Add(new EventMessage(
                "Kan ikke slette",
                "Kontroller der er publiceret, kan ikke slettes.",
                EventMessageType.Warning));
    
            e.Cancel = true;
        }
    

    (The cancellation works fine.)

    Having read other posts, but no luck finding anything with a solution. Also tried .CancelOperation()

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies