Get the Widget Execution Context BX24.placement.info

Choose a tool for developing with an AI agent:

  • use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
  • use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation

Scope: placement

Who can execute the method: any user

The method BX24.placement.info retrieves the handler call context: the code of the placement where the widget is open and the parameters passed along with it.

BX24.placement.info();
        

Parameters

The method takes no parameters and returns the result immediately, without a callback function.

Code Examples

How to Use Examples in Documentation

BX24.ready(function () {
            BX24.init(function () {
                const placementInfo = BX24.placement.info();
        
                console.info(placementInfo.placement, placementInfo.options);
            });
        });
        
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide)
        import type { B24Frame } from '@bitrix24/b24jssdk'
        
        declare const $b24: B24Frame
        
        // the same data is available as properties of the placement manager
        console.info($b24.placement.placement, $b24.placement.options)
        
<!-- 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()
        
            console.info($b24.placement.placement, $b24.placement.options)
          })
        </script>
        

Result

{"placement":"CRM_LEAD_LIST_MENU","options":{"ID":"1348"}}
        

Returned Data

Name
type

Description

placement
string

The code of the placement where the widget is open. For a widget opened through the main application link — DEFAULT

options
object

The placement parameters. The set of keys depends on the placement: for example, the identifier of a CRM item or the identifier of a chat. The keys of each placement are described on its page in the placement catalog

Errors

The method returns no errors. If placement contains DEFAULT while a placement was expected, the widget was opened through the main application link rather than from a registered placement.

Continue Learning