Documentation

lists.section.add

Scope: catalog Permissions to execute: for all

lists.section.add(
   params
)

The method creates a list section. Returns true on success, otherwise throws Exception.

Parameters

Parameter Description Available from version
IBLOCK_TYPE_ID Information block type ID (required). Possible values:
  • lists - type of list iblock
  • bitrix_processes - type of process iblock
  • lists_socnet - type of group list iblock
IBLOCK_CODE/IBLOCK_ID Information block Code or ID (required).
SOCNET_GROUP_IDGroup ID (required when creating list for group);
IBLOCK_SECTION_ID Parent section ID. In not specified, root section is indicated.
FIELDS Array of fields and values: Available fields are described in the Structure for Iblock Module Tables. Required fields: NAME.
SECTION_CODE Section character code (required).

Example

/* lists.section.add */
var params = {
   'IBLOCK_TYPE_ID': 'lists',
   'IBLOCK_CODE': 'rest_1',
'FIELDS': {
'NAME': 'Section_1',
'SECTION_CODE': 'Section_code_1'
}
};
BX.rest.callMethod(
   'lists.section.add',
   params,
   function(result)
   {
       if(result.error())
           alert("Error: " + result.error());
       else
           console.log(result.data());
   }
);

© «Bitrix24», 2001-2024