+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Accessing Dynamic Content Item when hooking into IDynamicContentUpdated Event

Accessing Dynamic Content Item when hooking into IDynamicContentUpdated Event

2 posts, 0 answered
  1. BoaMike
    BoaMike avatar
    51 posts
    Registered:
    25 Sep 2009
    06 Oct 2014
    Link to this post

    I am following the instructions found Here to hook into the Event fired when a Dynamic Content item is updated.  However, it appears the documentation is out of date?  I am trying to access the actual content item that was updated, but eventInfo.Item throws an error....  actually everything but eventInfo.UserId throws an error.  How can I access the actual content item that was published...  and how do I only execute my code when the Live version is publishe?

    private void IDynamicContentUpdatedEvent(IDynamicContentUpdatedEvent eventInfo)
            {
                var userId = eventInfo.UserId;
                var modificationDate = eventInfo.ModificationDate;
                var dynamicContentItem = eventInfo.Item;
                var visible = eventInfo.Visible;
            }

  2. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    Registered:
    05 Dec 2016
    09 Oct 2014
    Link to this post
    Hello Michael,

    I have just tested the behavior on my side on a test Sitefinity 7.2 project and the IDynamicContentUpdatedEvent was fired when a dynamic content items is being updated. The UserID was also successfully retrieved from the eventInfo. I have also recorded a short video for your reference demonstrating the behavior on my side.

    Can you please let me know what is the exact error thrown when you get the UserId? In addition to this, can you please specify what is your current Sitefinity version where the issue is reproduced?

    Regards,
    Sabrie Nedzhip
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
2 posts, 0 answered