×

Schedules

A Schedule is a plan for carrying out a process or procedure, providing lists of intended events and times. The Scenario (project) object has a default Schedule, as do individual Resources.

Resource schedules inherit the effects of calendars in the project or of calendars in any groups the resources are inside, but they don't inherit the calendars themselves. For example, if you add a vacation day in the project calendar, every resource will not work that day, but that doesn't change each resource's individual calendars.

Think of it this way:

Instance Properties

The properties of an instance of the Schedule class:

Instance Functions

Here are the functions that can be called on an instance of the Schedule class.

The following script example uses the startDate and endDate properties of the Scenario class (not to be confused with the startDate() and endDate() functions of the Schedule class), along with the durationBetween(…) instance function of the Schedule class, in order to display a dialog showing the current length of the project measured in days.

omniplan://localhost/omnijs-run?script=try%7BsDate%20%3D%20actual%2EstartDate%0AeDate%20%3D%20actual%2EendDate%0AprojectDuration%20%3D%20actual%2Eschedule%2EdurationBetween%28sDate%2CeDate%29%0AprojectDays%20%3D%20projectDuration%2EworkSeconds%2F86400%0AprojectDays%20%3D%20projectDays%2EtoFixed%282%29%0AalertTitle%20%3D%20%22Project%20Length%20in%20Days%22%0AalertMessage%20%3D%20%22The%20current%20project%20length%20is%20%22%20%2B%20String%28projectDays%29%20%2B%20%22%20days%2E%22%0Anew%20Alert%28alertTitle%2C%20alertMessage%29%2Eshow%28%29%7Dcatch%28err%29%7Bconsole%2Elog%28err%29%7D
Show Project Length in Days
 

var sDate = actual.startDate var eDate = actual.endDate var projectDuration = actual.schedule.durationBetween(sDate, eDate) var projectDays = projectDuration.workSeconds/86400 projectDays = projectDays.toFixed(2) var alertTitle = "Project Length in Days" var alertMessage = "The current project length is " + String(projectDays) + " days." new Alert(alertTitle, alertMessage).show()
project-length-sheet