ITask.SetFieldValue Method

Writes a value to a task field cell, directly to a workbook.
Sub SetFieldValue( _ 
ByVal fieldMnemonic As String, _ 
ByVal newValue As Object, _ 
Optional ByVal writeWhereForBranches As PositionInWbsBranch = PositionInWbsBranch.Auto _ 
)
This language is not supported or no code example is available.
void SetFieldValue( 
string fieldMnemonic
object newValue
PositionInWbsBranch writeWhereForBranches = PositionInWbsBranch.Auto 
)
This language is not supported or no code example is available.

Parameters

fieldMnemonic
string

The identifier (mnemonic) of the column.

newValue
object

The value to be written, text or number.

writeWhereForBranches
PositionInWbsBranch

Optional. Specifies whether to write to bottom or to top of branches. The default value is PositionInWbsBranch.Auto.

Exception type Condition

QdvApiException

A problem occurred.

Remarks
 

This function works only for the current opened estimate. You cannot write to WBS of a foreign estimate.

Notice that this function might be particularly slow because it emulates a manual input. It is only suitable for changing a few cells and it is interesting only because it doesn’t require a call to the IEstimate.CheckAndRepaint method afterwards.

To significantly improve the performance when calling SetFieldValue method multiple times, it is recommended to temporarily turn off the automatic calculation of the WBS workbook. See IWbs.WbsWorkbookCalculationMode property for examples.

For bulk changes, we recommend to use the SetFieldsValuesToDb method which writes directly to the database in a much faster way. This function requires a call to IEstimate.CheckAndRepaint at the end to update the WBS workbook.

You cannot set blob values, i.e. embedded files, with this method. If you want to set the values of the fields that have their IWbsField.DataType set to WbsFieldDataType.AnyFile, such as "_Document" or "_Workbook", you need to call StoreBlob method.

Note, there may be a dialog displayed asking how to delete child tasks in some special cases. It happens in a branch, if you set an empty string as a value of some WBS fields from minutes. Such fields are standard WBS fields from minutes (breakdown fields), where the "Values to break down" is a minute field that has no breakdown options. To suppress this dialog from your macros, simply set the field value to " " (one space) instead of an empty string. If you pass a non-empty string value, the dialog will not be displayed and the "Delete on selected branch and all sub branches and minutes" option will be applied. The result will be exactly the same as if you passed an empty string.

Version
 
Available since QDV 7.13.0001.

.NET Framework

Supported in: 4.8, 4.7, 4.6, 4.5.2

In this article

Definition