PS.ProjectContext.current property (ps.js)
Office 2013 and later
Gets the current client context of the Project Server 2013 client-side runtime.
Last modified: February 15, 2013
Applies to: Project Professional 2013 | Project Server 2013
var value = PS.ProjectContext.get_current()
The following code example shows how to get the current context. 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: