PublishedProject.IncludeCustomFields property

Gets a PublishedProject object that includes custom fields.

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

Syntax

'Declaration
<RemoteAttribute> _
Public ReadOnly Property IncludeCustomFields As PublishedProject
    Get
'Usage
Dim instance As PublishedProject
Dim value As PublishedProject

value = instance.IncludeCustomFields
[RemoteAttribute]
public PublishedProject IncludeCustomFields { get; }

Property value

Type: Microsoft.ProjectServer.Client.PublishedProject
A published project.

Remarks

For projects with many custom fields, performance can be slow when retrieving and saving the project. When you use the PublishedProject.CheckOut method to check out a project, by default, the DraftProject object does not include custom fields. By using the IncludeCustomFields property, the project that is checked out includes custom field information.

Examples

The following CheckoutProject method checks out a project that includes custom fields.

private static DraftProject CheckoutProject(ProjectContext projContext, string projName)
{
    DraftProject projCheckedOut = null;

    var projCollection = projContext.LoadQuery(
        projContext.Projects
            .Where(p => p.Name == projName));

    projContext.ExecuteQuery();

    if (projCollection.Count() > 0)
    {
        PublishedProject proj2Edit = projCollection.First().IncludeCustomFields;

        projCheckedOut = proj2Edit.CheckOut().IncludeCustomFields;
    }
    return projCheckedOut;
}

For another code example, see IncludeCustomFields.

See also

Reference

PublishedProject class

PublishedProject members

Microsoft.ProjectServer.Client namespace

PublishedProject.CheckOut

DraftProject.IncludeCustomFields