QPR Knowledge Base

SetProperties

Hide Navigation Pane

SetProperties

Previous topic Next topic No expanding text in this topic  

SetProperties

Previous topic Next topic JavaScript is required for expanding text Mail us feedback on this topic!  

Comments (...)

Revision history:

Introduced in QPR 7.2.1

Last changed in QPR 8.0.1 SP3

 

Properties must be a same kind of two-dimensional variant array that GetProperties returns except that only properties whose values are set are listed. First column contains property names and second column contains values. If setting of any of the listed properties fails, the whole operation is cancelled.

 

Synopsis:

 

SCModel.SetProperties(ElementId, Properties)

 

Parameters:

 

ElementId: Integer. ID of some element.

Properties: Array. Two-dimensional array of property names and values. The following properties are supported depending on the element type:

ElementID refers to a scorecard:

 NAME, String

 SYMBOL, String

 DESCRIPTION, String

 OWNER, Integer (user ID)

 PARENTSCORECARDID, Integer

 BASESCORECARD, Integer

 INHERITANCEOPTIONS. A two-dimensional array with 2 columns. The rows are a freely selectable set of the following inheritance options in the first column (one option per row) with the second column containing a flag indicating whether the option should be enabled (1) or disabled (0):

name
description
elementtype
measureunit
roles
valuesettings
periodlevel
accumulationrule
indicatorproperties
chartproperties
viewsettings
seriessettings
values
scorecardstructure
scorecardstructure_noref
scorecardstructure_addonly

ElementID refers to a measure:

 NAME, String

 SYMBOL, String

 DESCRIPTION, String

 PARENTELEMENTID, Integer

 MEASUREUNITID, Integer

 INCHARGE, Integer (user ID). Sets a user to the primary role defined for the element.

 ACCUMULATIONRULE, Integer:

Sum = 0
Average = 1
Min = 2
Max = 3
First = 4
Last = 5
Sum (ignore null) = 6
Average (ignore null) = 7
None = 8
Latest = 10

 VALUESETTINGID, Integer

 PERIODLEVELID, Integer

 ELEMENTSERIES. A two-dimensional array with 6 columns. One line is defined per ElementSeries and the array has the following columns (properties):

Series Id, Integer
ElementSeries Label, String
ElementSeries UnitId, Integer
ElementSeries AccumulationRule, see the ACCUMULATIONRULE property description for reference about possible values
ElementSeries Inputtype. The possible values are 0 (Manual input), 1 (Formula), 2 (SQL), or 3 (ADO). Integer.
ElementSeries Formula (empty string if formula does not exist). String.        

 CHARTTEMPLATE (name of the template). String.

 CHARTTEMPLATEID (ID of the template). Integer.

ROLES. A two-dimensional array of roles defined for the measure. The array contains one line per role, and the first line is the primary role corresponding to "In charge" user in earlier versions of QPR ScoreCard. The array has the following columns:

id, Integer. ID of the role
name, String. Name of the role. Use an empty string here as the SetProperties function uses only ID-based matching.
userId, Integer. ID of the user assigned to the role.

DRILLDOWNOPTIONS, a two-dimensional array with two columns. The rows are a freely selectable set of the following drill down options in the first column (one option per row) with the second column containing the value of a subproperty or a flag indicating whether the option should be enabled (1) or disabled (0):

enableautomaticreferencing, Boolean: true | 1 | false | 0.
drilldowndepth, Integer.
referencewithsymbol, Boolean: true | 1 | false | 0. Reference elements with matching Symbol.
referencewithname, Boolean: true | 1 | false | 0. Reference elements with matching Name.
removeunmatching, Boolean: true | 1 | false | 0. Removes unmatching reference elements.

ElementID refers to a period level:

 NAME, String

 SYMBOL, String

 DESCRIPTION, String

 PERIODLEVELPREFIX, String

 PERIODLEVELTYPE, Integer:

Year = 100
Half year = 200
Third = 300
Quarter = 400
Month = 500
Week = 600
Day = 700
Custom = 800

 PERIODLEVELACCUMULATION, Integer:

First day of period = 0
Last day of period = 1
Middle of period = 2

ElementID refers to a range:

 NAME, String

 SYMBOL, String

 DESCRIPTION, String

 RANGEVALUE, Integer

ElementID refers to a history chart template:

 NAME, String

 SYMBOL, String

 DESCRIPTION, String

 AUTHOR, Integer (user ID)

ElementID refers to a series:

NAME, String

SYMBOL, String

DESCRIPTION, String

REVERSEDTREND, Boolean (0 = false, 1 = true)

TRENDTYPE Integer (0 = two period difference, 1 = one period polarity).

DEFAULTFORMULA, String

ElementID refers to a value setting:

 NAME, String

 SYMBOL, String

 DESCRIPTION, String

 DEFAULTSERIESID, Integer

 FORCEMIN, Boolean (0 = false, 1 = true)

 FORCEMAX, Boolean (0 = false, 1 = true)

ElementID refers to a information item:

 NAME, String

 SYMBOL, String

 DESCRIPTION, String

 LOCATION, String

ElementID refers to a measure unit:

 NAME, String

 SYMBOL, String

 DESCRIPTION, String

 UNITSYMBOL, String

 NUMBEROFDECIMALS, Integer

 DECIMALSEPARATOR, String

 DIGITSINGROUP, Integer

 DIGITSEPARATOR, String

 UNITBEFOREVALUE, Boolean (0 = false, 1 = true)

ElementID refers to an alert:

 ALERTTYPE, Integer:

Value changed = 0
Value in range = 1
Value missing = 2

 ALERTRANGEID, Integer

 DELAYED, Boolean (0 = false, 1 = true)

 ALERTDELAY, Integer

 ALERTURL, String

 RECIPIENTS. One-dimensional array of user and group IDs. All IDs must be valid and have access to the model and element.

ElementID refers to a linked element:

NAME, String

SYMBOL, String

DESCRIPTION, String

AUTHOR, Integer

STATUS, Integer (0 = Draft, 1 = Proposal, 2 = Obsolete, 3 = Accepted)

ElementID refers to an element type:

NAME, String

SYMBOL, String

DESCRIPTION, String

ROLES. A two-dimensional array of roles defined for the element type. The array contains one line per role, and the first line is the primary role corresponding to "In charge" user in earlier versions of QPR ScoreCard. The array has the following columns:

id, Integer. ID of the role
name, String. Name of the role.
description, String. Description of the role.

 

Note: In the case the ElementID points to a reference element, any properties not visible for reference elements are set to the original element instead. Reference elements can have the following properties: order, level, index, parentelementid, referenceid, sourcemodelid, sourceobjectid, and scorecardid.

 

Required Rights:

 

At least update rights to the element. BASESCORECARD and INHERITANCEOPTIONS properties require administrator or model administrator rights.

 

Return Values:

Below are listed the return values that this function can return:

 

RV_SUCCESS

RV_MODEL_NOT_OPEN

RV_APPLICATION_QUIT_CALLED

RV_NOT_CONNECTED_TO_SERVER

RV_NOT_AUTHENTICATED

RV_ELEMENT_NOT_FOUND

RV_NO_RIGHTS

RV_INVALID_PARAMETER

RV_PROPERTY_NOT_SUPPORTED

RV_PROPERTY_CANNOT_BE_UPDATED

RV_SYMBOL_IS_RESERVED

RV_INVALID_PARAMETER

RV_TOO_LONG_STRING

RV_UNKNOWN_ERROR

 

Example Procedure:

 

iRet = SCModel.SetProperties(iMeaId, Properties)

 

Comments (...)