Identifies the behavior of the specified field.
A field can be mandatory, optional, or read-only. If the entity is not an editable Entity object, this method always returns the value READONLY. If the Entity object is editable, because an action has been initiated, the return value can be READONLY, MANDATORY, or OPTIONAL.
This method never returns the value USE_HOOK. If the behavior of the field is determined by a permission hook, Rational ClearQuest will have already executed that hook and cached the resulting value. This method then returns the cached value.
You can use the GetFieldNames method to obtain a list of valid names for the field_name parameter.
VBScript
entity.GetFieldRequiredness(field_name)
Perl
$entity->GetFieldRequiredness(field_name);
VBScript
' Changer toutes les zones obligatoires en zones facultatives
' Extraire la collection de zones
fieldNameList = GetFieldNames
For Each fieldName in fieldNameList
' Apprendre si la zone sélectionnée est obligatoire
fieldReq = GetFieldRequiredness(fieldName)
if fieldReq = AD_MANDATORY
' Puisqu'elle est obligatoire, la rendre facultative
Then SetFieldRequirednessForCurrentAction fieldName, AD_OPTIONAL
End If
Next
Perl
# Changer toutes les zones OBLIGATOIRES en zones FACULTATIVES
# Extraire la collection de zones
$fieldnamelist = $entity->GetFieldNames();
foreach $fieldname (@$fieldnamelist){
# Apprendre si la zone sélectionnée est obligatoire
$fieldreq = $entity->GetFieldRequiredness($fieldname);
if ($fieldreq eq $CQPerlExt::CQ_MANDATORY)
{
# Puisqu'elle est obligatoire, la rendre facultative
$entity->SetFieldRequirednessForCurrentAction($fieldname, $CQPerlExt::CQ_OPTIONAL);
}
}