1

I want to display a notification message in tridion after deleting a component, but no message is coming after deleting component.

My Code:-

public void Subscribe()
    {
        EventSystem.Subscribe<Component, DeleteEventArgs>(DeleteS3FileOnAWS, EventPhases.TransactionCommitted);
    }
    private void DeleteS3FileOnAWS(Component comp, DeleteEventArgs args, EventPhases phase)
    {
        var session = comp.Session;
        var message = new NotificationMessage
        {
            Action = "Delete",
            SubjectIds = new[] { comp.Id.ToString() },
            Details = string.Format("Component was deleted by {0}", session.User.Description)
        };

        session.NotificationsManager.BroadcastNotification(message);}

Could anyone help me on this?

  • Do you know whether it'd dropping into the DeleteS3FileOnAWS() method at all? I.e. Is it that the Events System code isn't firing or that there's a problem with the Notifications Manager code? – Jonathan Williams Dec 5 '19 at 8:48
  • 1
    Did you configure your Model/Editor Extension and notification broadcaster Handler Javascript function? – Velmurugan Dec 5 '19 at 9:10
  • I think Velmurugan is right. This confused me at first too, but you do need a model/editor extension AND the notification message fired via the event-system. – Josh Hebb Dec 5 '19 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.