IMinute.InsertSetAtRow (Int32, String, Int32, String, Double, InputFieldsFromSetImage) Method
Parameters
- pathNumber
- int
The path number where the set database can be found.
- databaseName
- string
The name of the set database including the '.grp' extension.
- row
- int
The line number where the set will be inserted, 1-based.
- setReference
- string
The reference of the set in the set database specified with databaseName.
- setQuantity
- double
The quantity of the set.
- inputFields
- InputFieldsFromSetImage
The info about inputs to the set. If the set specified by the setReference doesn't contain any input fields, the inputFields parameter may be null reference (Nothing in Visual Basic). If the set contains input fields, this value must contain proper input fields, otherwise an exception will be thrown.
Exception type | Condition |
---|---|
A problem occurred. |
|
A problem occurred. For example, if the set specified by the setReference contains input fields, which are not supplied by this method. |
For historical reasons, this method doesn't throw any exception in case of any error. Instead, the error will be stored as a global error (if it was empty) in IGlobalErrors
When the TaskInGantt field refers to only one task, the function returns a string which contains the unique description of the task. When the TaskInGantt field refers to several tasks, the function returns "<Multi>". Then you have to use the GetMultipleTaskInGanttAssignation function to get info about these tasks.See IMinute documentation for details about hidden "FreeField" field.
This method requires the internal cache to be up to date, which is ususally the case, but there are some exceptions and you need to refresh it manually, see below.
Some methods use the internal cache for retrieving the minutes data. This is for performance reasons, especially, when one minute
is accessed multiple times. These are (let's name them group 1):
GetFieldValue,
SetFieldValue,
SetFieldValue,
UpdateValuesConditionally,
IEstimateVersion.UpdateMinuteValues.
And there are some methods that modify the minutes data, but they don't update the internal cache for performance reasons. These are (let's name them group 2):
ClearRowValues,
DeleteRow,
InsertRows,
InsertSetAtRow,
InsertSetAtRow,
GroupRows,
UngroupRows,
UpdateRowsFromDatabases.
So if you use the methods from group 2, you should update the internal cache manually before you call any method from the group 1. The cached data can be updated and retrieved with GetFullData method. You can update the cache also with the IWbs.Refresh method, but is it slower, because it does much more work.
You can later test if the Set Image contains a file or values to be converted into an object by invoking GetTypeOfSetImage function.
If the set contains input fields, the inputFields must contain proper input fields, otherwise an exception will be thrown. The set image contains the values of the imported set. They are stored in the heading rows of sets.
About input fields
This method is not intended to update a set, only to insert it.
For historical reasons, when an error is encountered during insertion of the set, a prompt window will be displayed to the user asking for an action. If you want to avoid this UI, you must call the InsertSetAtRow method which has a parameter where you can specify the action.