|
||
Revision history:
Introduced in QPR 7.2.1
Last changed in QPR 2012
Returns a variant array of elements of given type sorted by name. Note! In order to avoid memory consumption, remember to empty the variant containing the returned variant array after the array is not needed anymore.
Synopsis:
SCModel.GetElements(Type, out Elements)
Parameters:
Type, either typeid or typename
Elements, variant array filled with data of the following types:
SCORECARD
INFORMATIONITEM
PERIOD
PERIODLEVEL
RANGE
SERIES
VALUESETTING
INTEGRATION
UNIT
CHARTTEMPLATE
ALERT
ELEMENT
LINKEDDATA
+ all user-defined element and linked element types
The array contains the following columns:
•element name, string
•id, integer
•identifier, string
•scorecard id, integer
•scorecard identifier, string
•Valuesettingid (for series and ranges only), integer
•PeriodLevelid (for periods only), integer
Required Rights:
Administrator or Model Administrator rights to the SCModel.
Return Values:
Below are listed the return values that this function can return:
RV_SUCCESS
RV_MODEL_NOT_OPEN
RV_INVALID_PARAMETER
RV_TYPE_NOT_FOUND
RV_NO_ELEMENTS_FOUND
RV_NO_RIGHTS
RV_UNKNOWN_ERROR
Example Procedure:
Sub FetchElements()
Dim iResult
Dim Elements
Dim I
for I = 0 to 10000
iResult = SCModel.GetElements(2, Elements)
If iResult <> 0 then
Elements = Empty
Exit Sub
End If
'do something with the Elements table
Elements = Emtpy
next
End Sub