Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8290275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:45:28+00:00 2026-06-08T12:45:28+00:00

I am adding event handler for CheckOutEventArgs , and am trying to get the

  • 0

I am adding event handler for CheckOutEventArgs, and am trying to get the checkout user details. Below is my code.

public void Subscribe()
{
    EventSystem.Subscribe<Page, CheckOutEventArgs>(PageCheckOutWarning,
                                                   EventPhases.Initiated);
    EventSystem.Subscribe<Component, CheckOutEventArgs>(ComponentCheckOutWarning,
                                                        EventPhases.Initiated);
} 

private void ComponentCheckOutWarning(Component component, 
                                      CheckOutEventArgs args, EventPhases phase)
{
    logdetails("Checkout User-->" + component.CheckOutUser.Title.ToString());
}

When I try to checkout the Component/Page I get this error in the Tridion Explorer error message box.

Object Reference not set to an instance of an object

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:45:30+00:00Added an answer on June 8, 2026 at 12:45 pm

    You have subscribed to Initiated phase, in this phse item is not checked out yet, hence no CheckOutUser. You should subscribe to some of the later phases.

    Also, I don’t know what your code is doing, but you might consider subscribing to some generic class, like VersionedItem that contains both component and page.

    Again, not knowing your idea, but take a look at SubscribeAsync method if you want to have just warning. This way it will execute faster.

    If you still want to know the user in the initiated phase – you can get it from session:
    component.Session.User.Title

    You can subscribe to VersionedItem and then in the event handler do:

    private void CheckOutWarning(VersionedItem item, CheckOutEventArgs args, EventPhases phase)
    {
        if (item.GetType().Name == "Component" || item.GetType().Name == "Page")
        {
        }
    }
    

    Do you want to have just warning, or do you want to prevent CheckOut?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In C# adding event handler methods is very easy. You just type object.event +=
By adding a custom handler to the SiteMapResolve event, I can update sitemap url's
I have the following code adding an ActionListener to a JTextField: chatInput.addMouseListener(new java.awt.event.MouseAdapter() {
Relates to the problem Adding event handler in main() for SerialPort After I change
I have situation where in c# code I am adding an onclick client event
How would one go about adding an event handler to a control in a
I'm adding a DataGridViewComboBoxColumn to a DataGridView during the form's Load event handler and
Possible Duplicate: C# Adding and Removing Anonymous Event Handler suppose I have an Action
How do I create an event handler in my Perl code to intercept all
I want to add a control to a user control in an event handler

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.