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

CreateReferenceElement

Scroll Prev Top Next More

Revision history:

Introduced in QPR 7.2.1

 

Creates a reference element of the given source element. Reference is created to given scorecard and to the position specified by ParentId parameter.

 

Synopsis:

 

SCModel.CreateReferenceElement(SourceID, ScorecardId,  ParentID, out Id)

 

Parameters:

 

SourceId: Integer. ID of some existing element

ScorecardId: Integer. ID of some existing scorecard

ParentId: Integer. ID of some existing element or 0. If 0, then reference is created under the top element

Id: Integer. ID of the new reference 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_SCORECARD_NOT_FOUND

RV_PARENT_NOT_FOUND

RV_ELEMENT_NOT_FOUND

RV_CANNOT_SET_ELEMENT_TYPE

RV_UNKNOWN_ERROR

 

Example Procedure:

 

iRet = oModel.CreateReferenceElement(iMeaId, iSCId, 0, Id)