Call the Registered Interface Command BX24.placement.call

If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.

Scope: placement

Who can execute the method: any user

The method BX24.placement.call invokes an interface command registered by the current placement.

BX24.placement.call(command, parameters[, callback]);
        

Parameters

Required parameters are marked with *

Name
type

Description

command*
string

The name of the command to invoke

parameters
any

Passed parameters. The value type depends on the command: object, string, number, array, or null. Commands without parameters accept an empty object {}

callback
callable

Callback function. It receives the result of the command

For example, the command setValue of the USERFIELD_TYPE placement accepts the new field value as its second argument:

BX24.placement.call('setValue', value, () => {});
        

Available Commands

The set of commands is defined by the placement where the widget is open. There is no single list covering all placements: check it with BX24.placement.getInterface.

In the b24jssdk library, the second argument is optional: omit it for commands without parameters.

Placement

Commands

CALL_CARD

getStatus, disableAutoClose, enableAutoClose

PAGE_BACKGROUND_WORKER

CallCardSetMute, CallCardSetHold, CallCardSetUiState, CallCardGetListUiStates, CallCardSetCardTitle, CallCardSetStatusText, CallCardStartTimer, CallCardStopTimer, CallCardClose

CALENDAR_GRIDVIEW

getEvents, viewEvent, addEvent, editEvent, deleteEvent

CRM_*_DETAIL_TAB, CRM_*_DETAIL_ACTIVITY, CRM_*_LIST_MENU

reloadData — refreshes the CRM item card or the item list

Activity in the CRM timeline

setLayout, setLayoutItemState, setPrimaryButtonState, setSecondaryButtonState, bindLayoutEventCallback, bindValueChangeCallback, lock, unlock, finish — rendering of the standard activity interface

Client search and requisite autocomplete

crmShowFoundEntities, crmShowCreatedEntity — pass the found options and the created CRM object

USERFIELD_TYPE

setValue, getValue. For a usage example, see the tutorial How to Embed a Widget into a Lead as a Custom Field

Block on a website

refreshBlock — redraws the block after the application makes changes

Settings of a robot application

setPropertyValue — writes property values into the robot form

Besides the commands of the placement, general methods are available to the widget — for example BX24.resizeWindow. They are not returned in the list from BX24.placement.getInterface.

Code Examples

How to Use Examples in Documentation

BX24.ready(function () {
            BX24.init(function () {
                BX24.placement.call('getStatus', {}, function (result) {
                    console.log(result);
                });
        
                BX24.placement.call('CallCardSetCardTitle', {title: 'hello world!'}, function (result) {
                    console.log(result);
                });
            });
        });
        
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide)
        import type { B24Frame } from '@bitrix24/b24jssdk'
        
        declare const $b24: B24Frame
        
        const result = await $b24.placement.call('getStatus')
        
        console.log(result)
        
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
        <script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
        <script>
          document.addEventListener('DOMContentLoaded', async () => {
            const $b24 = await B24Js.initializeB24Frame()
        
            const result = await $b24.placement.call('getStatus')
        
            console.log(result)
          })
        </script>
        

Result

The content of the result is defined by the command itself and described on the command page. Commands that return nothing pass an empty array to the callback function, while read commands pass an object or an array with data.

A command returns its error to the same place — the JS interface has no separate error channel. For example, when there is no call card, the call card commands pass an array with an object:

[
            {
                "result": "error",
                "errorCode": "Call card is undefined"
            }
        ]
        

Errors

A placement silently ignores an unknown command: the callback function is not invoked and no error arrives. A call made from a placement where the command does not exist behaves the same way.

Check two conditions:

  • the widget is open in the placement where the command is registered. The current placement is returned by BX24.placement.info
  • the command name is passed without typos and with the correct capitalization. The list of available commands is returned by BX24.placement.getInterface

Continue Learning