IMinutesField Interface

Represents a Minutes field in the Minutes Fields manager.
Public Interface IMinutesField
This language is not supported or no code example is available.
public interface IMinutesField
This language is not supported or no code example is available.
Name Description
Public property Allowed Gets or sets a view in which the field can be inserted.
Public property ColumnType Gets or sets the column type of the field.
Public property Comment Gets or sets the comment of the field.
Public property ConditionalFormula Gets or sets the conditional formula of the field.
Public property CopyInsideGroup Gets or sets a value indicating whether a value should be propagated onto all rows of a group, when this value is entered in the header of that group.
Public property CopyInsideSet Gets or sets a value indicating whether a value should be propagated onto all rows of a set, when this value is entered in the header of that set.
Public property DefaultValue Gets or sets the default value of the field.
Public property DifferentiatorForArticles Gets or sets a value indicating whether two rows with different values for this field will be displayed as separated rows or as merged in the nomenclatures.
Public property EntryAllowed Gets or sets a view in which the field entry is possible.
Public property FieldName Gets or sets the name of the field.
Public property FieldNameMultilingual Gets the name of the field in the multi-language format. Can be used for reading and editing.
Public property ForNomenclaturesOnly Gets or sets a value indicating whether the field is ignored in the minutes.
Public property Formula Gets or sets the formula of the field.
Public property IgnoreFromDatabaseOfEstimate Gets or sets the 'Ignored from database of the estimate' value of the field.
Public property Instructions Gets the instructions (flags) of the field.
Public property ListBoxData Gets or sets the Listbox data of the field.
Public property Mnemonic Gets the mnemonic of the field.
Public property ParentName Gets or sets the parent name of the field.
Public property ParentNameMultilingual Gets or sets the parent name of the field in the multi-language format. Can be used for reading and editing.
Public property PartOf Gets or sets the 'Is part of cost or selling price' value of the field.
Public property ProgressField Gets or sets the progress field to which this field refers.
Public property ProgressStatement Gets or sets a progress statement number, if this field refers to a value of another field at a specific progress statement.
Public property ReplaceWhenUpdating Gets or sets the 'Replace when updating' value of the field.
Public property ReplacementField Gets or sets the replacement field of the field.
Public property SharedField Gets or sets a value indicating whether the field is passed from the parent to the child. The child has to fill it in with its own formulas or manually.
Public property ShowDefaultValue Gets or sets a value indicating whether the default value is visible.
Public property ShowInTotals Gets or sets the 'Show in totals' value of the field.
Public property ShowRowsGrouped Gets or sets what is to be displayed in headers of groups when they are collapsed.
Public property SpecialFormula Gets or sets special formula which applies to the first row of groups when the groups are shown grouped.
Public property UniqueField Gets or sets a value indicating whether the value of this field is unique across the estimate for a given reference, when the field 'Synchronize when unique' is equal to one (1).
Public property VisibleInDatabaseOfEstimate Gets or sets a value indicating whether this field is visible in Database of the estimate view (tab).
Public property VisibleInEstimate Gets or sets a value indicating whether this field is visible in 'Estimate' mode.
Public property VisibleInMinutes Gets or sets a value indicating whether this field is visible in Minutes view (tab).
Public property VisibleInOverheadMinute Gets or sets a value indicating whether this field is visible in Overhead Minute view (tab).
Public property VisibleInProgress Gets or sets a value indicating whether this field is visible in 'Progress statement' mode.
Top
Methods
 
Name Description
Public method GetFormatting(EstimateColumnsView) Gets the column formatting info of the field. The formatting is user specific. It describes how the field is displayed in a specific view.
Public method SetFormatting(EstimateColumnsView, IColumnFormatting) Sets the column formatting of the field for the current user. The formatting is user specific. It describes how the field is displayed in a specific view.
Public method SetFormatting(EstimateColumnsView, IColumnFormatting, FieldUserScope) Sets the column formatting of the field for the specified users. The formatting is user specific. It describes how the field is displayed in a specific view.
Top
Remarks
 

You can read and modify the field properties. However, the changes will not be applied to the estimate until you call IMinutesFieldManager.ApplyChanges method. However, this is not necessary after calling SetFormatting method.

When you modify properties of a field, the values are automatically validated. Some value combinations are not allowed or properties are simply disabled in some contexts. For example, the ReplacementField property is not available in free fields. If you try to set this property for a free field, a QdvApiException will be thrown.

Similarly, if the Formula property is set to a non empty string, then the DefaultValue property is not available. If the DefaultValue property was set and then the Formula property is set, the former one will be automatically cleared. Exactly as if you did that in Fields Manager UI.

Therefore, it is extremely important to set the IMinutesField properties in the correct order! Otherwise you could encounter unexpected values of the properties that were already set; or exceptions in a better case. It's recommended to try the process manually in the Fields Manager UI first.

Example
 

The following example creates a new field named "aaa" and sets some of its properties.

Try
     Dim fieldMan As Fields.IMinutesFieldManager = Es.GetMinutesFieldManager()
     Dim field As Fields.IMinutesField
     If Not fieldMan.FieldExists("AAA") Then
         ' Create a new field 'aaa'.
         field = fieldMan.AddField("AAA", "aaa")
        
         ' Set the field properties. Not all combinations are allowed.
         ' Some are commented out (with an explanation) for testing.
         field.Comment = "aaa comment"
         field.ConditionalFormula = "=1"
         field.CopyInsideGroup = True
         field.CopyInsideSet = True
         field.ColumnType = FieldColumnType.Numeric
         'field.ColumnType = FieldColumnType.Text
         field.DefaultValue = "10"
         field.DifferentiatorForArticles = True
         field.FieldName = "Field aaa"   ' this sets the name in the current QDV locale
         field.FieldNameMultilingual.SetText("Field aaa FR", "fr")
         field.FieldNameMultilingual.SetText("Field aaa EN", "en-us")
         field.ForNomenclaturesOnly = False
         field.IgnoreFromDatabaseOfEstimate = True
         field.ListBoxData = "aaa|bbb|ccc|[FreeInput]"
         'field.Formula = "=30"  ' if this is set, many other properties cannot be set and throw an exception
         field.ParentName = "ccc"
         field.ParentNameMultilingual.SetText("ccc belgian", "Fr-be")
         field.PartOf = FieldIsPartOfKind.Costs
         field.ProgressField = ""
         'field.ProgressStatement = 1    ' if this is set, many other properties cannot be set and throw an exception
         'field.ReplacementField = "repl"    ' not available for free fields
         'field.EntryAllowed = FieldEntryAllowedView.WBSOnly
         'field.SharedField = Not field.SharedField ' cannot be set if field.EntryAllowed = FieldEntryAllowedView.WBSOnly
         field.ReplaceWhenUpdating = FieldReplaceWhenUpdatingKind.WhenBlank ' cannot be set when Formula is defined
         field.ShowDefaultValue = True ' cannot be set when Formula is defined
         field.ShowInTotals = FieldShowInTotalsKind.ResultOfFormula ' cannot be set when Formula is defined
         field.ShowRowsGrouped = FieldShowRowsGroupedKind.SpecialFormula ' cannot be set when Formula is defined
         field.SpecialFormula = "=40" ' cannot be set when Formula is defined
         field.UniqueField = True ' cannot be set when Formula is defined
         field.VisibleInEstimate = False
         field.VisibleInProgress = False
         'field.EntryAllowed = FieldEntryAllowedView.MinutesAndNomenclatures
         field.Allowed = FieldAllowedView.MinutesAndNomenclatures    'ignored and set to Minutes only if ProgressField or ProgressStatement properties are set
         'field.ColumnType = FieldColumnType.WordDocument
     Else
         field = fieldMan.GetField("AAA")
         field.Formula = "=IF([WPU] <> 0 , 2, 0)"
     End If
     fieldMan.ApplyChanges()
 Catch ex As Exception
     MessageBox.Show(ex.ToString())
 End Try					
This language is not supported or no code example is available.
try
 {
     Qdv.UserApi.Fields.IMinutesFieldManager fieldMan = es.GetMinutesFieldManager();
     Qdv.UserApi.Fields.IMinutesField field;
     if (!fieldMan.FieldExists("AAA"))
     {
         // Create a new field 'aaa'.
         field = fieldMan.AddField("AAA", "aaa");
        
         // Set the field properties. Not all combinations are allowed.
         // Some are commented out (with an explanation) for testing.
         field.Comment = "aaa comment";
         field.ConditionalFormula = "=1";
         field.CopyInsideGroup = true;
         field.CopyInsideSet = true;
         field.ColumnType = FieldColumnType.Numeric;
         //field.ColumnType = FieldColumnType.Text;
         field.DefaultValue = "10";
         field.DifferentiatorForArticles = true;
         field.FieldName = "Field aaa";   // this sets the name in the current QDV locale
         field.FieldNameMultilingual.SetText("Field aaa FR", "fr");
         field.FieldNameMultilingual.SetText("Field aaa EN", "en-us");
         field.ForNomenclaturesOnly = false;
         field.IgnoreFromDatabaseOfEstimate = true;
         field.ListBoxData = "aaa|bbb|ccc|[FreeInput]";
         //field.Formula = "=30";    // if this is set, many other properties cannot be set and throw an exception
         field.ParentName = "ccc";
         field.ParentNameMultilingual.SetText("ccc belgian", "Fr-be");
         field.PartOf = FieldIsPartOfKind.Costs;
         field.ProgressField = "";
         //field.ProgressStatement = 1;  // if this is set, many other properties cannot be set and throw an exception
         //field.ReplacementField = "repl";  // not available for free fields
         //field.EntryAllowed = FieldEntryAllowedView.WBSOnly;
         //field.SharedField = Not field.SharedField; // cannot be set if field.EntryAllowed = FieldEntryAllowedView.WBSOnly
         field.ReplaceWhenUpdating = FieldReplaceWhenUpdatingKind.WhenBlank; // cannot be set when Formula is defined
         field.ShowDefaultValue = true; // cannot be set when Formula is defined
         field.ShowInTotals = FieldShowInTotalsKind.ResultOfFormula; // cannot be set when Formula is defined
         field.ShowRowsGrouped = FieldShowRowsGroupedKind.SpecialFormula; // cannot be set when Formula is defined
         field.SpecialFormula = "=40"; // cannot be set when Formula is defined
         field.UniqueField = true; // cannot be set when Formula is defined
         field.VisibleInEstimate = false;
         field.VisibleInProgress = false;
         //field.EntryAllowed = FieldEntryAllowedView.MinutesAndNomenclatures;
         field.Allowed = FieldAllowedView.MinutesAndNomenclatures;    //ignored and set to Minutes only if ProgressField or ProgressStatement properties are set
         //field.ColumnType = FieldColumnType.WordDocument;
     }
     else {
         field = fieldMan.GetField("AAA");
         field.Formula = "=IF([WPU] <> 0 , 2, 0)";
     }
     fieldMan.ApplyChanges();
 }
 catch (Exception ex)
 {
     MessageBox.Show(ex.ToString());
 }					
This language is not supported or no code example is available.

Version
 
Available since QDV 7.16.585.

.NET Framework

Supported in: 4.8, 4.7, 4.6, 4.5.2

In this article

Definition