Modifying publication and created dates of news

Posted by Community Admin on 04-Aug-2018 14:30

Modifying publication and created dates of news

All Replies

Posted by Community Admin on 20-Mar-2012 00:00

Hello teleric team. I started using sitefinity CMS a week ago. And I cant change the publication and created dates of the news item to back date, using next code:
var Item = App.WorkWith().NewsItems().Where(nI => nI.Title.ToString() == "isa")
 //"isa" - title of my news item
.ForEach(nI =>
           
                var val = DateTime.Parse(NewDate.Text);
                nI.PublicationDate = val;
                nI.DateCreated = val;
            ).SaveChanges();

And I got this: Exception has been thrown by the target of an invocation. Please, help me.

Posted by Community Admin on 23-Mar-2012 00:00

Hi,

If you wish to change news publication back date, I would suggest taking a look at this blog post. This should guide in you in changing the news date.

Please let us know if you have anymore questions.

Kind regards,
Grace Hallwachs
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items

This thread is closed