Identifica el comportamiento del campo especificado.
Un campo puede ser obligatorio, opcional o de sólo lectura. Si la entidad no es un objeto Entity editable, este método siempre devuelve el valor READONLY. Si el objeto Entity es editable, porque se ha iniciado una acción, el valor de retorno puede ser READONLY, MANDATORY u OPTIONAL.
Este método nunca devuelve el valor USE_HOOK. Si un enganche de permiso determina el comportamiento del campo, Rational ClearQuest ejecuta antes el enganche y almacena el valor resultante en antememoria. A continuación, este método devuelve el valor almacenado en antememoria.
Puede utilizar el método GetFieldNames para obtener una lista de nombres válidos para el parámetro 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);
}
}