Share via


WorkflowActivities.ReadIntegerProperty method

Reads the value of of the specified project property by using the SharePoint SPFieldType.Integer type.

Namespace:  Microsoft.ProjectServer.Client
Assembly:  Microsoft.ProjectServer.Client (in Microsoft.ProjectServer.Client.dll)

Syntax

'Declaration
<RemoteAttribute> _
Public Function ReadIntegerProperty ( _
    projectId As Guid, _
    propertyId As String _
) As ClientResult(Of Integer)
'Usage
Dim instance As WorkflowActivities
Dim projectId As Guid
Dim propertyId As String
Dim returnValue As ClientResult(Of Integer)

returnValue = instance.ReadIntegerProperty(projectId, _
    propertyId)
[RemoteAttribute]
public ClientResult<int> ReadIntegerProperty(
    Guid projectId,
    string propertyId
)

Parameters

  • propertyId
    Type: System.String

    The GUID of the property to read.

Return value

Type: Microsoft.SharePoint.Client.ClientResult<Int32>
The Integer value of the property.

Remarks

A Project Server workflow can call the ReadIntegerProperty method. Valid propertyId values can be retrieved from the WorkflowDesigner.Fields collection by using the WorkflowDesignerField.Id property. The ReadIntegerProperty method works only with fields where the WorkflowDesignerField.SPFieldType property is SPFieldType.Integer.

Note

Reading an Optimizer Decision field fails if the Portfolio Analyzer has not finished with the project. To ensure that the project is committed before reading the value, you can set a Wait for Commit activity in the workflow.

For example, use the following REST query on a project that is not committed in Portfolio Analyzer (all on one line):

https://ServerName/pwa/_api/ProjectServer/WorkflowActivities/
    ReadIntegerProperty(projectId='<YOUR-PROJID>',propertyId='Optimizer%20Decision')

If the Optimizer Decision field is a null reference (Nothing in Visual Basic), the query gives the following result:

PJClientCallableException: WorkflowActivityInvalidArgument WorkflowActivityInvalidArgument 
Error = Project property not found: propertyName = Optimizer Decision, 
mdPropUid = 00000000-0000-0000-0000-000000000000

See also

Reference

WorkflowActivities class

WorkflowActivities members

Microsoft.ProjectServer.Client namespace