Skip to content

Latest commit

 

History

History
58 lines (34 loc) · 1.82 KB

Project.Application.SetField.md

File metadata and controls

58 lines (34 loc) · 1.82 KB
title keywords f1_keywords ms.service api_name ms.assetid ms.date ms.localizationpriority
Application.SetField method (Project)
vbapj.chm3
vbapj.chm3
project-server
Project.Application.SetField
9f0670a9-b7e3-0bb6-40fc-0dcae63a3c19
06/08/2017
medium

Application.SetField method (Project)

Sets the value of a local custom field or enterprise custom field for the selected tasks or resources.

Syntax

expression. SetField( _Field_, _Value_, _Create_ )

expression A variable that represents an Application object.

Parameters

Name Required/Optional Data type Description
Field Required String The name of the field to set.
Value Required String The value of the field.
Create Optional Boolean True if a new value is created; otherwise, False. The default value is True.

Return value

Boolean

Remarks

If the custom field uses a lookup table that does not allow additional items to be entered, the specified Value must match a predefined value in the lookup table.

If the value of the Field argument does not exist as a custom field name for the selected items, the SetField method results in run-time error 1101.

Example

The following example sets the value of an enterprise task text custom field to one of the valid values in the lookup table for the custom field. To use the example, create a lookup table in Project Web App that includes the value Value 3, and then create a task custom text field that uses that lookup table. Select a task in the active project and run the command in the Immediate window in the Visual Basic Editor.

Application.SetField Field:="TestEntTaskText", Value:="Value 3"

[!includeSupport and feedback]