IMinutesField Interface
Name | Description | |
---|---|---|
Allowed | Gets or sets a view in which the field can be inserted. | |
ColumnType | Gets or sets the column type of the field. | |
Comment | Gets or sets the comment of the field. | |
ConditionalFormula | Gets or sets the conditional formula of the field. | |
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. | |
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. | |
DefaultValue | Gets or sets the default value of the field. | |
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. | |
EntryAllowed | Gets or sets a view in which the field entry is possible. | |
FieldName | Gets or sets the name of the field. | |
FieldNameMultilingual | Gets the name of the field in the multi-language format. Can be used for reading and editing. | |
ForNomenclaturesOnly | Gets or sets a value indicating whether the field is ignored in the minutes. | |
Formula | Gets or sets the formula of the field. | |
IgnoreFromDatabaseOfEstimate | Gets or sets the 'Ignored from database of the estimate' value of the field. | |
Instructions | Gets the instructions (flags) of the field. | |
ListBoxData | Gets or sets the Listbox data of the field. | |
Mnemonic | Gets the mnemonic of the field. | |
ParentName | Gets or sets the parent name of the field. | |
ParentNameMultilingual | Gets or sets the parent name of the field in the multi-language format. Can be used for reading and editing. | |
PartOf | Gets or sets the 'Is part of cost or selling price' value of the field. | |
ProgressField | Gets or sets the progress field to which this field refers. | |
ProgressStatement | Gets or sets a progress statement number, if this field refers to a value of another field at a specific progress statement. | |
ReplaceWhenUpdating | Gets or sets the 'Replace when updating' value of the field. | |
ReplacementField | Gets or sets the replacement field of the field. | |
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. | |
ShowDefaultValue | Gets or sets a value indicating whether the default value is visible. | |
ShowInTotals | Gets or sets the 'Show in totals' value of the field. | |
ShowRowsGrouped | Gets or sets what is to be displayed in headers of groups when they are collapsed. | |
SpecialFormula | Gets or sets special formula which applies to the first row of groups when the groups are shown grouped. | |
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). | |
VisibleInDatabaseOfEstimate | Gets or sets a value indicating whether this field is visible in Database of the estimate view (tab). | |
VisibleInEstimate | Gets or sets a value indicating whether this field is visible in 'Estimate' mode. | |
VisibleInMinutes | Gets or sets a value indicating whether this field is visible in Minutes view (tab). | |
VisibleInOverheadMinute | Gets or sets a value indicating whether this field is visible in Overhead Minute view (tab). | |
VisibleInProgress | Gets or sets a value indicating whether this field is visible in 'Progress statement' mode. |
Name | Description | |
---|---|---|
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. | |
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. | |
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. |
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.
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.