Please enable JavaScript to view this site.

QPR Knowledge Base 2019.1

Navigation: Developer's Guide > QPR API > The Object Model > QPR Metrics > SCModel Commands

CreateElement

Scroll Prev Top Next More

Revision history:

Introduced in QPR 2012

 

Creates a new element to the specified scorecard and under the given ParentId element. Sets also name and identifier. Returns ID of new element in the Id parameter.

 

Synopsis:

 

SCModel.CreateElement(Typeid, Name, Identifier, ScorecardId, ParentId, out Id)

 

Parameters:

 

TypeId: Integer, if 0, then element of default measuretype is created

Name: String

Identifier: String. If this is empty, system generates a identifier for the element

ScorecardId: Integer. Must be ID of some existing scorecard

ParentId: Integer. If this is 0, element is created under the top element

Id: Integer. ID of the created element is returned in this parameter

 

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_NO_RIGHTS

RV_CANNOT_SET_ELEMENT_TYPE

RV_INVALID_NAME

RV_IDENTIFIER_IS_RESERVED

RV_INVALID_IDENTIFIER

RV_SCORECARD_NOT_FOUND

RV_PARENT_NOT_FOUND

RV_INVALID_ELEMENT_TYPE

RV_TYPE_NOT_FOUND

RV_UNKNOWN_ERROR

 

Example Procedure:

 

iRet = SCModel.CreateElement(0, "New Element", "", SCId, 0, Id)