Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the date/time at which the item was last published in Tridion

How can I get the date/time at which the item was last published.

I tried to create object for PublishInfoData inorder to use PublishedAt.

  PublishInfoData pobj = csClient.Read(pageTCMID, readoptions) as PublishInfoData;

But this gives error like cannot convert IdentifiableObjectData to PublishInfoData.

Please suggest.

like image 221
user1658567 Avatar asked Oct 23 '12 14:10

user1658567


1 Answers

This will give you all publish info:

csClient.GetListPublishInfo(pageTCMID);

And then you have to select the latest:

var publishInfo = csClient.GetListPublishInfo(pageTCMID);
var lastPublishedAt = publishInfo.OrderByDescending(pi => pi.PublishedAt).First().PublishedAt;
like image 101
Andrey Marchuk Avatar answered Oct 16 '22 09:10

Andrey Marchuk