Bitrix Site Manager

CForm::GetFieldList

record set
CForm::GetFieldList(
 int FORM_ID,
 varchar additional,
 varchar &by,
 varchar &order,
 array arFilter=array(),
 boolean &is_filtered
);

The method is used to retrieve a list of the form questions and/or fields.

Parameters

ParameterDescription
FORM_ID Form ID.
additional Denotes which information to return.
  • "" or "ALL" - return both questions and fields 
  • "Y" - return fields; 
  • "N" - return questions.
by Allows to specify the name of the field by which the sorting is to be performed. The following values allowed:
  • s_id - by the result ID
  • s_active - by the active state flag
  • s_varname - by the symbolic identifier
  • s_c_sort - by sort weight
  • s_title - by title
  • s_comments - by comments
  • s_required - by the required state of a question or field
  • s_in_results_table - by inclusion in the results table
order Sort order. The following values apply:
  • desc - descending (default)
  • asc - ascending
arFilter Array used as the values filter. The following key names apply:
  • ID - ID of a question or field (complex logics allowed)
  • TITLE - text of a question or field (complex logics allowed)
  • VARNAME - symbolic identifier (complex logics allowed)
  • COMMENTS - comment (complex logics allowed)
  • ACTIVE - active state flag: "Y" - active; "N" - inactive;
  • IN_RESULTS_TABLE - flag indicating the inclusion in the results table: "Y" - included; "N" - not included;
  • IN_FILTER - flag indicating the inclusion in the filter: "Y" - included; "N" - not included;
  • REQUIRED - flag indicating the field is required: "Y" - required; "N" - not not required;
is_filtered Contains true on return if the results has been filtered, or false otherwise.

Return Values

Returns a database record containing the form parameters.

Example



$arFilter = Array(
    "ID"                => $find_id,
    "TITLE"             => $find_title,
    "VARNAME"           => $find_varname,
    "ACTIVE"            => $find_active,
    "IN_RESULTS_TABLE"  => $find_in_table,
    "IN_FILTER"         => $find_in_filter,
    "REQUIRED"          => $find_required,
    "COMMENTS"          => $find_comments
    );
$rsFields = CForm::GetFieldList($WEB_FORM_ID, 
                                $additional,
                                $by,
                                $order,
                                $arFilter,
                                $is_filtered);