Documentation

lists.add

Scope: catalog Permissions to execute: for all

Description

lists.add (params)

This method creates a list. Returns true on success, otherwise throws an exception.

Parameters

ParameterDescription
IBLOCK_TYPE_ID information block type ID (required):
  • lists - information block type for lists
  • bitrix_processes - information block type for processes
  • lists_socnet - information block type for workgroup lists
IBLOCK_CODE information block code (required);
SOCNET_GROUP_IDworkgroup ID (required, if the list is created for a workgroup);
FIELDSinformation block fields:
  • NAME - information block name (required);
  • DESCRIPTION - description;
  • SORT - sorting;
  • PICTURE - image;
  • BIZPROC - enabling workflow support.
MESSAGESdescriptors to elements and sections of the list;
RIGHTSaccess rights management (if not filled, then complete access to the created Information block is granted to the authorized user, who is working with REST).

Example

    var params = {
        'IBLOCK_TYPE_ID': 'lists_socnet',
        'IBLOCK_CODE': 'rest_1',
        'SOCNET_GROUP_ID': '4',
        'FIELDS': {
            'NAME': 'List 1',
            'DESCRIPTION': 'Test list',
            'SORT': '10',
            'PICTURE': document.getElementById('iblock-image-add'),
            'BIZPROC': 'Y'
        },
        'MESSAGES': {
            'ELEMENT_NAME': 'Element',
            'ELEMENTS_NAME': 'Elements',
            'ELEMENT_ADD': 'Add element',
            'ELEMENT_EDIT': 'Edit element',
            'ELEMENT_DELETE': 'Delete element',
            'SECTION_NAME': 'Section',
            'SECTIONS_NAME': 'Sections',
            'SECTION_ADD': 'Add section',
            'SECTION_EDIT': 'Edit section',
            'SECTION_DELETE': 'Delete section'
        },
        'RIGHTS': {
            'SG4_A': 'W',
            'SG4_E': 'W',
            'SG4_K': 'W',
            'AU': 'D',
            'G2': 'D'
        }
    };
    BX24.callMethod(
        'lists.add',
        params,
        function(result)
        {
            if(result.error())
                alert("Error: " + result.error());
            else
                alert("Success: " + result.data());
        }
    );


© «Bitrix24», 2001-2024
Up