|
||
Revision history:
Introduced in QPR 7.3.1
Extended version of CreateCopy. In addition to functionality provided by CreateCopy, CreateCopyEX supports copying hierarchies and copying elements as references.
Synopsis:
SCModel.CreateCopyEX(SourceID, ScorecardId, ParentID, WithHierarchy, AsReference, out Id)
Parameters:
SourceId: Integer. ID of object which is to be copied.
ScorecardId: Integer. ID of some existing object.
ParentId: Integer. If this is 0, then new element is created under the top element.
WithHierarchy: Integer. 0 = Copy only source element, 1=include sub-elements.
AsReference: Integer. 0 = Create normal Copy, 1 = Copy as reference element. NOTE! If AsReference = 1 and WithHierarchy = 1, then all elements are created as reference elements.
Id: Integer. ID of new object is returned in this parameter. NOTE! If WithHierarchy = 1, then a new root element ID is returned.
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_INVALID_ELEMENT_TYPE
RV_CANNOT_COPY_TOPELEMENT
RV_CANNOT_COPY_REFERENCE
RV_UNKNOWN_ERROR
Example Procedure:
iRet = SCModel.CreateCopyEX(iMeaId, ScorecardId, 0, 0, 1, Id)