지정된 레코드를 수정하여 다른 레코드의 중복임을 나타냅니다. 중복은 하위입니다. MarkEntityAsDuplicate를 호출하면 엔티티가 하위로 표시됩니다.
엔티티가 있는 경우 HasDuplicates 또는 IsDuplicate가 True면 Link 오브젝트 메소드를 호출하여 상위 및 하위 데이터를 검색할 수 있습니다.
이 메소드는 중복 레코드를 수정하지만 원본은 변경하지 않습니다. 중복의 상태는 스키마에 따라 변경될 수 있습니다. 데이터베이스에 적절한 링크가 추가됩니다. 중복은 modify 상태로 남습니다. 즉, 계속 필드를 업데이트할 수 있고 결과적으로 유효성을 검증하고 확인해야 합니다.
관리자는 유형 DUPLICATE의 여러 조치를 설정할 수 있습니다. (예를 들어, 조최는 사용 가능해지는 시기에 서로 다른 제한이 있거나 후크가 서로 다를 수 있습니다.) duplicate_action_name 매개변수에 DUPLICATE 유형의 조치를 지정해야 합니다.
VBScript
session.MarkEntityAsDuplicate duplicate, original, duplicate_action_name
Perl
$session->MarkEntityAsDuplicate(duplicate, original, duplicate_action_name);
VBScript
set sessionObj = GetSession idName = GetFieldValue("id").GetValue set currentObj = sessionObj.GetEntity("defect", idName) ' Mark the entity with ID="SAMPL00000031" as a duplicate of this entity. ' Use the action named "duplicate". set dupEntityObj = sessionObj.GetEntity("defect", "SAMPL00000031") sessionObj.MarkEntityAsDuplicate dupEntityObj, currentObj, "duplicate" ' Validate and commit the duplicate entity since it ' is currently modifiable. error = dupEntityObj.Validate if error = "" then dupEntityObj.Commit End If
Perl
#Get a Rational® ClearQuest® session
$sessionObj = $entity->GetSession();
#Mark the entity with ID="SAMPL00000031" as a duplicate of this
#entity. Use the action named "duplicate".
$dupEntityObj = $sessionObj->GetEntity("defect", "SAMPL00000031");
$sessionObj->MarkEntityAsDuplicate( $dupEntityObj, $entity, "duplicate" );
#Validate and commit the duplicate entity since it is currently modifiable
$error = $dupEntityObj->Validate();
if ( $error eq "" ) {
$dupEntityObj->Commit();
}