1

How can I modify a Component's PublishInfoData.PublishedAt property through Core Service? Code in C#

PublishInfoData[] pubInfo = _client.GetListPublishInfo(id);
PublishInfoData piData = pubInfo[0];
piData.PublishedAt = DateTime.Now;

How to save piData through Core Service?

2 Answers 2

2

Please elaborate on why you would like to do this?

To my understanding this is a read only property, since it is set at publish time by Tridion internally.

If you would like to display a 'published at' date on the website you can add a metadata field to the page or component. This is a common requirement.

However, certain system properties, such as the revisor, creation time, last update time, and publish time are updated to reflect a change of state in the system, and should not be modified by external Apis.

1

First, why do you want it this way? actually the PublishAt property internally set by Tridion to the time when the item published.

PublishInfoData class represent publishing information for Repository local objects, and PublishedAt is a property(GET/SET) of the class.

but I am not sure why do you want to save a object of type PublishInfoData, AFAIK it's not needed. just assign the value to the property should serve the purpose.

4
  • I publish a component through core service, method execute successfully, but the component's PublishInfoData.PublishedAt property did not update, so I want to change it manually.
    – Jacky Pei
    Commented May 5, 2014 at 6:32
  • well, GetListPublishInfo method returns collection of PublishInfoData one for each Target. are you sure you are checking it for right publication target? you are taking index 0 here as pubInfo[0], which is first one. Commented May 5, 2014 at 6:57
  • Please confirm that you really don't have the property updated - double-check the property. If it is not being updated, then it is a bug in Tridion and should be reported via customer support. However, I would be surprised if this is the case - since the GUI also uses Core Service for many operations...
    – robrtc
    Commented May 5, 2014 at 8:58
  • Thanks, now when I publish a component through core service, sometime publish success and "PublishAt" property is updated, sometime it is not, maybe it is the problem of my tridion environment, not the problem of core service.
    – Jacky Pei
    Commented May 9, 2014 at 3:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.