Project 2000. Custom Fields and Grouping, страница 13

On the other hand, if the “Link to project” checkbox is cleared when a project is inserted, the tasks and resources in the subproject are inserted as if they were typed directly into the master project, so any custom field attributes are not carried over. If a master project custom field has a formula, the subproject data is discarded and the values are calculated based on the master's formula. If a subproject custom field has a formula and the master does not, the results of the subproject calculations are just pasted into the master as plain data, similar to when a formula is deleted. If a custom field in the master has a restricted value list, the values in the subproject must conform to the list. If any values do not conform, the following message will be displayed:

Figure 29 - Restricted value list

If the user clicks OK, any non-compliant values are removed from the inserted data and replaced with the custom field’s default value (if one is defined) or with the Microsoft Project 2000 default for that field type if no custom field default is defined.

When pooling resources, the resource pool always takes precedence for resource custom field attributes. When a project is attached to a pool, the attributes for all resource custom fields are copied to the sharing project. Custom field properties can only be viewed or modified by opening the pool and accessing the Customize Fields dialog within the pool file. In the sharing project’s Customize Fields dialog, the Formula, Graphical Indicators, and Value List options buttons are all disabled while connected to the pool.

If a new resource is added to a sharer while the pool is not open and a value list item is specified for a resource custom field with a restricted value list, and in the mean time, the original value list in the pool is modified and that same list item is removed, then when the pool is opened for synchronization the value in the sharer field will be considered invalid and the following message will be displayed:

Figure 30 - Value list in Resource pool is modified

When the user clicks OK, synchronization with the pool continues, but the offending custom field reverts to the default value.


Programmability

Changes to Existing Methods

The following table lists existing Microsoft Project VBA methods that are either custom field-related or are newly impacted by the enhancements to custom fields.

Method

New or Changed Functionality

CustomizeField

Displays the new Customize Fields dialog.

Organizer

The Type argument now accepts the new PjOrganizer constant pjFields for displaying the Fields tab in the Organizer dialog.

OrganizerDeleteItem

The Type argument now accepts the new PjOrganizer constant pjFields for specifying Fields as the type of item to delete.

OrganizerMoveItem

The Type argument now accepts the new PjOrganizer constant pjFields for specifying Fields as the type of item to move.

New Methods

A number of new VBA methods have been provided to work with the new custom field functionality. The new methods are listed in the following table along with a brief description. For more information on each method, use the Object Browser in the Microsoft Project 2000 Visual Basic Editor.

Method

Description

CustomFieldProperties Method

Sets various attributes associated with custom fields.

CustomFieldSetFormula Method

Sets a formula for a custom field.

CustomFieldGetFormula Method

Returns the formula associated with a custom field.

CustomFieldIndicators Method

Sets options for graphical indicators for a custom field.