Example checking in a Component with a user comment
The following code includes a comment provided by the user while checking a Component.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tridion.ContentManager.CommunicationManagement;
using Tridion.ContentManager.ContentManagement;
using Tridion.ContentManager.Security;
using Tridion.ContentManager.Workflow;
namespace MyOrganization.ContentManager.Tests
{
public class CodeSample
{
Session _Session = new Session("User_Name");
public void CheckInItemsWithUserComment(TcmUri componentId)
{
Component component = (Component) _Session.GetObject(componentId);
component.CheckOut(true);
component.Title = "Updated Title";
component.CheckIn(removePermanentLock: true, userComment: "Title Updated");
}
}
}