Documentation

Delete

bool
CFormField::Delete(
 int field_id,
 string check_rights = "Y"
)

The method Delete deletes a question or a [link= 6660053]field[/link] and all its answers. Returns true on success, or false otherwise.

Parameters

Parameter Description
field_id The ID of the [link= 6660053]question[/link] or the [link= 6660053]field[/link].
check_rights Flag specifying the current user [link= 6660053]permissions[/link] should be checked. One of the following values is possible:
  • Y - permissions should be checked;
  • N - no checks need to be performed.
For this method to succeed, you should have the [link= 6660053]permission[/link] [30] full access for the destination web form containing the field field_id.
Optional. "Y" by default which means the permissions should be checked.

See Also

Example



<?
$FIELD_ID = 140;
// delete the question #140
if (CFormField::Delete($FIELD_ID))
{
    echo "The question #140 has been deleted.";
}
else
{
    // display the error description
    global $strError;
    echo $strError;
}
?>
© «Bitrix24», 2001-2024
Up