Table of contents
API
TOC
Collapse the table of content
Expand the table of content

EnterpriseResourceCollection class

Nadin Merali|Last Updated: 5/6/2017

inherits members from ClientObjectCollection

Represents a collection of EnterpriseResource objects.

Syntax

CSOM

class EnterpriseResourceCollection 

JSOM

PS.EnterpriseResourceCollection

REST Interface

Supported.

PS.EnterpriseResourceCollection

http://contoso.sharepoint.com/sites/pwa/api/ProjectServer/EnterpriseResources

Members

✓ - Read Support       ✓ʷ - Write Support

Properties

Name.NETJSOMRESTTypeDescription
[Integer]EnterpriseResourceGets a EnterpriseResource from the collection at the specified index.
ItemEnterpriseResourceGets a EnterpriseResource from the collection at the specified index.
SelfEnterpriseResourceGets the enterprise resource object for the current user.

Methods

Name.NETJSOMRESTReturn TypeDescription
Add(EnterpriseResourceCreationInformation ercinfo)EnterpriseResourceAdds the enterprise resource that is specified by the EnterpriseResourceCreationInformation object to the collection.
GetByGuid(Guid uid)EnterpriseResourceGet an enterprise resource from the collection with the specified GUID.
GetById(String Id)EnterpriseResourceGets an enterprise resource from the collection with the Name value.
GetByUser(SPUser user)EnterpriseResourceReturns an enterprise resource from the collection linked to the SharePoint user.
Remove(EnterpriseResource resource)BooleanRemoves the specified enterprise resource from a project.
Self()EnterpriseResourceGets the enterprise resource object for the current user.
Update()VoidUpdates the enterprise resource collection.


Method Details

'{EnterpriseResourceId}'

Gets a EnterpriseResource from the collection with the specified EnterpriseResourceId.

Syntax
EnterpriseResource http://contoso.sharepoint.com/sites/pwa/api/ProjectServer/EnterpriseResources('{EnterpriseResourceId}')
Parameters
NameTypeDescription
EnterpriseResourceIdStringthe id of the EnterpriseResource
Return Value

EnterpriseResource

Add(EnterpriseResourceCreationInformation parameters)

Adds the EnterpriseResource that is specified by the EnterpriseResourceCreationInformation object to the collection.

Syntax
EnterpriseResource Add(EnterpriseResourceCreationInformation parameters)
Parameters
NameTypeDescription
parametersEnterpriseResourceCreationInformationThe properties that can be set when creating a enterprise resource.
Return Value

EnterpriseResource

GetByGuid(Guid uid)

Gets a EnterpriseResource from the collection with the Id value.

Syntax
EnterpriseResource GetByGuid(Guid uid)
Parameters
NameTypeDescription
uidGuidThe Guid of the EnterpriseResource
Return Value

EnterpriseResource

GetById(String objectId)

Gets a EnterpriseResource from the collection with the Guid value.

Syntax
EnterpriseResource GetById(String objectId)
Parameters
NameTypeDescription
objectIdStringThe id of the EnterpriseResource.
Return Value

EnterpriseResource

GetByUser(SPUser user)

Returns an element from the collection linked to the SharePoint user.

Syntax
EnterpriseResource GetByUser(SPUser user)
Parameters
NameTypeDescription
userSPUserAn object of type User.
Return Value

EnterpriseResource

Remove(EnterpriseResource resource)

Removes the specified EnterpriseResource from the collection.

Syntax
Boolean Remove(EnterpriseResource resource)
Parameters
NameTypeDescription
resourceEnterpriseResourceThe EnterpriseResource to remove.
Return Value

Boolean True if the object is removed from the collection; otherwise, False.

Self()

Gets the current enterprise resource from the collection.

Syntax

Self()

Parameters

none

Return Value

EnterpriseResource
An EnterpriseResource object.

Update()

Updates the enterprise resource collection.

Syntax
void Update()
Parameters

None

Return Value

void

See Also

EnterpriseResource
EnterpriseResourceCreationInformation
ProjectContext
SPUser

© 2018 Microsoft