IWbsFieldsRepository.UpdateField (IWbsField, Boolean, FieldUserScope) Method
Updates a field, whether the complete definition or just the formatting for the specified users.
This language is not supported or no code example is available.
This language is not supported or no code example is available.
Parameters
-
field
-
IWbsField
The field to be updated.
-
onlyFormatting
-
bool
Indicates whether only the field formatting is to be saved (including 'hidden by user/admin' info). If true,
the field definition will not be saved.
-
forUsers
-
FieldUserScope
<default>
IWbsField newWbsField = es.WbsFieldsRepository.CreateFieldInstance(WbsFieldKind.FreeField, "MYFIELD" ); |
newWbsField.FieldName = "My new field" ; |
newWbsField.SubHeader = "created by a macro" ; |
es.WbsFieldsRepository.AddField(newWbsField); |
newWbsField.Formatting.HiddenByAdmin = false ; |
newWbsField.Formatting.HiddenByUser = false ; |
newWbsField.Formatting.ColumnWidth = 20; |
newWbsField.Formatting.Header1Formatting.ForeColor = System.Drawing.Color.Red; |
newWbsField.Formatting.Header2Formatting.ForeColor = System.Drawing.Color.DarkGreen; |
newWbsField.Formatting.DataFormatting.BackgroundColor = System.Drawing.Color.LightPink; |
es.WbsFieldsRepository.UpdateField(newWbsField, false , FieldUserScope.AllUsers); |
IWbsField quantityField = es.WbsFieldsRepository.GetFieldByMnemonic( "WBS_Quantity" ); |
es.WbsFieldsRepository.SetFieldPosition(newWbsField, |
FieldPlacementPosition.AfterGivenField, |
FieldUserScope.AllUsers); |
es.WbsFieldsRepository.RepaintWbsWithChanges(); |
This language is not supported or no code example is available.
The following example creates a new free WBS field, changes its formatting. At the end, the position of the new
field is set to be right after the "WBS_Quantity" field. And this is done for all users, not for just the current
one.
Available since QDV 7.18.655.
.NET Framework
Supported in: 4.8, 4.7, 4.6, 4.5.2