Documentation > CMS Template API Library > Asset > SetSchedule(String,DateTime,TimeZoneInfo,Boolean)

SetSchedule

Allows you to set a scheduled workflow transition (usually a publish or retire) for the specified asset. You must provide the schedule name as configured in the workflow. The schedule date must include a date and time and a sourceTimeZone.

public System.Boolean SetSchedule(String,DateTime,TimeZoneInfo,Boolean)

Parameters

NameDescriptionType
scheduleName Name of the schedule. System.String
dateTime The date time. System.DateTime
sourceTimeZone The timezone of the DateTime that is passed in. System.TimeZoneInfo
publishDependencies Optional: Include dependencies when publishing the asset. Defaults to false. System.Boolean

Code Example

C#

Sample:
// "Live Date" must be defined in the workflow for this asset!
// This will go Live on June 30, 2014 at 3 PM Eastern
asset.SetSchedule("Live Date", new DateTime(2014, 6, 30, 15, 0, 0), TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"));

Connect with Crownpeak