API
Version 7.x > API > Setting "Published from" and "to" using API and not workflow View modes: 
User avatar
Member
Member
magnus-tenk - 1/3/2013 2:11:54 PM
   
Setting "Published from" and "to" using API and not workflow
I can't seem to find out how to set these values using the API..

My application is "replicating" data out of another DB and creating documents based on this information. What I need now is to manage their "IsPublished" preferably without using Kenticos workflows (archived) as the data isn't under KenticoDB's version control.

Any pointers? I would prefer to not be naughty and access the Document-table "raw", but I just can't get my head around the way to go about the scheduled content publishing concept.

/Magnus


User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/4/2013 1:20:29 AM
   
RE:Setting "Published from" and "to" using API and not workflow
Hi,

Have you tried using:

TreeNode newNode = TreeNode.New(className, tree);
...
newNode.SetValue("DocumentPublishFrom", DateTime.Now);


And the same applies for DocumentPublishTo column. You just need to set appropriate date value.

Best regards,
Juraj Ondrus