PS.ProjectContext.projects property (ps.js)
Office 2013 and later
Gets the collection of published projects in the Project Web App instance.
Last modified: February 15, 2013
Applies to: Project Professional 2013 | Project Server 2013
var value = PS.ProjectContext.get_projects()
PS.ProjectCollection
A collection of PublishedProject objects.
The following code example shows how to get the published projects in the current Project Web App instance. See Getting started with the JavaScript object model for the complete code example.
function GetProjects() { // Initialize the current client context. var projContext = PS.ProjectContext.get_current(); // Get the projects collection. projects = projContext.get_projects(); // Register the request that you want to run on the server. // This call includes an optional "Include" parameter to request only the // Name, CreatedDate, and Id properties of the projects in the collection. projContext.load(projects, 'Include(Name, CreatedDate, Id)'); // Run the request on the server. projContext.executeQueryAsync(onQuerySucceeded, onQueryFailed); }
Show: