Call the CRM Object Selection Dialog BX24.selectCRM
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
BX24.selectCRM(params: object, callback: callable): void;
The BX24.selectCRM method displays the standard dialog for selecting leads, contacts, companies, deals, and estimates.
Bitrix24 renders the dialog over the application frame. The application does not need to retrieve the list of CRM items: users see only the items they can access. The dialog requires no scope of its own because it opens the Bitrix24 interface instead of calling the REST API.
The method can be called only from an application embedded in a Bitrix24 frame. Call it inside the BX24.init handler.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
entityType |
Object types to display in the dialog. Possible values:
The method excludes unsupported values. If the parameter is omitted or the list is empty after unsupported values are excluded, the method displays leads, contacts, and companies |
|
multiple |
Allows selecting multiple objects. Default is |
|
value |
Objects to mark as selected when the dialog opens (detailed description). The method ignores identifiers less than one. If |
|
callback* |
Callback function that receives the selected CRM objects (detailed description) |
value Parameter
The key of the value object is a CRM object type, and the value is an array of numeric identifiers. Pass only the types specified in entityType.
|
Name |
Description |
|
lead |
Lead identifiers |
|
contact |
Contact identifiers |
|
company |
Company identifiers |
|
deal |
Deal identifiers |
|
quote |
Estimate identifiers |
Code Example
Display a multiple-selection dialog, preselect several items, and output the selected objects:
BX24.init(() => {
BX24.selectCRM(
{
entityType: ['lead', 'contact', 'company', 'deal', 'quote'],
multiple: true,
value: {
lead: [1348, 2, 35],
contact: [2],
company: [4, 3],
deal: [1, 2],
quote: [1]
}
},
(selected) => {
console.log(selected);
}
);
});
How to Use Examples in Documentation
Response Handling
The dialog does not return data directly. After the selection is confirmed, callback receives an object whose items are grouped by CRM type: lead, contact, company, deal, and quote.
If the user closes the dialog using the close or cancel button, callback is not called.
{
"lead": {
"0": {
"id": "L_1348",
"type": "lead",
"place": "lead",
"title": "Guest #2 - Bitrix Open Channel",
"desc": "Guest",
"url": "/crm/lead/show/1348/"
}
},
"contact": {
"0": {
"id": "C_2",
"type": "contact",
"place": "contact",
"title": "Klaus Weber",
"desc": "",
"url": "/crm/contact/show/2/",
"image": "/upload/resize_cache/crm/8b5/25_25_2/MM35_PG13.jpg"
}
},
"company": {},
"deal": {},
"quote": {}
}
Returned Data
Each object key contains selected items of the corresponding type. Items are stored under numeric keys 0, 1, and so on.
|
Name |
Description |
|
lead |
Selected leads |
|
contact |
Selected contacts |
|
company |
Selected companies |
|
deal |
Selected deals |
|
quote |
Selected estimates |
Selected Item Fields
|
Name |
Description |
|
id |
Item identifier with a type prefix: |
|
type |
CRM item type: |
|
place |
Item type in the dialog interface |
|
title |
Item name |
|
desc |
Additional item description. Its contents depend on the object type |
|
url |
Relative path to the CRM item form |
|
image |
Relative path to the item image. The field may be absent |
|
largeImage |
Relative path to the large item image. The field may be absent |
|
customData |
Additional item data. Returned if the selection component supplied the data |
|
advancedInfo |
Extended item information. Returned if the selection component supplied the data |
Error Handling
The dialog returns no error codes. The method ignores unsupported entityType values and invalid identifiers in value. If the user closes the dialog without confirming the selection, callback is not called.