SetStatus
bool CFormResult::SetStatus( int result_id, int status_id, string check_rights = "Y" )
Sets the new status for the result. Returns true on success and false otherwise. Non-static method.
Parameters
Parameter | Description |
---|---|
result_id | ID of the result.. |
status_id | The new status ID. |
check_rights | Specifies that the current user access permissions should be checked. The following values are possible:
|
Return Values
Returns true on success, or false otherwise.
Example
<? $RESULT_ID = 189; // result ID $STATUS_ID = 1; // the ID of the status "Published" // assign a new status to a result // check current user permissions if (CFormResult::SetStatus($RESULT_ID, $STATUS_ID)) { echo "Status #".$STATUS_ID." for #".$RESULT_ID." successfully set."; } else // error { global $strError; echo $strError; } ?>
© «Bitrix24», 2001-2024