지정된 필드의 동작을 식별합니다.
필드는 필수, 선택적 또는 읽기 전용일 수 있습니다. 엔티티가 편집 가능한 Entity 오브젝트가 아니면 이 메소드는 항상 READONLY라는 값을 리턴합니다. 조치가 초기화되어 Entity 오브젝트가 편집 가능하면, 리턴값은 READONLY, MANDATORY 또는 OPTIONAL일 수 있습니다.
이 메소드에서는 USE_HOOK 값이 리턴되지 않습니다. 필드의 동작이 권한 후크에 의해 결정될 경우, Rational® ClearQuest®는 이미 해당 후크를 실행하여 결과 값을 캐시했을 것입니다. 그런 다음 이 메소드는 캐시된 값을 리턴합니다.
GetFieldNames 메소드를 사용하여 field_name 매개변수에 대한 올바른 이름 목록을 확보할 수 있습니다.
VBScript
entity.GetFieldRequiredness(field_name)
Perl
$entity->GetFieldRequiredness(field_name);
VBScript
' Change all mandatory fields to optional
' Retrieve the collection of fields
fieldNameList = GetFieldNames
For Each fieldName in fieldNameList
' Find out if the selected field is mandatory
fieldReq = GetFieldRequiredness(fieldName)
if fieldReq = AD_MANDATORY
' Since it is, make it optional
Then SetFieldRequirednessForCurrentAction fieldName, AD_OPTIONAL
End If
Next
Perl
# Change all MANDATORY fields to OPTIONAL
# Retrieve the collection of fields
$fieldnamelist = $entity->GetFieldNames();
foreach $fieldname (@$fieldnamelist)
{
# Find out if the selected field is mandatory
$fieldreq = $entity->GetFieldRequiredness($fieldname);
if ($fieldreq eq $CQPerlExt::CQ_MANDATORY)
{
# Since it is, make it optional
$entity->SetFieldRequirednessForCurrentAction($fieldname,
$CQPerlExt::CQ_OPTIONAL);
}
}