lists.add
lists.add (params, fields)
This method deletes a list. Returns true on success, otherwise throws an exception.
Parameters
Parameter | Description |
---|---|
IBLOCK_TYPE_ID | information block type ID (required):
|
IBLOCK_CODE | information block code (required); |
SOCNET_GROUP_ID | workgroup ID (required, if the list is created for a workgroup); |
FIELDS | information block fields:
|
MESSAGES | descriptors to elements and sections of the list; |
RIGHTS | access 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-2023