DialogManager
Class
Used for displaying standard dialogs.
TIP
You can test working with B24Frame.parent in this example.
Methods
selectUser
ts
async selectUser(): Promise<null|SelectedUser>
Displays a standard dialog for selecting a single user.
Shows only company employees.
Returns a Promise
that resolves to null
or a SelectedUser
object.
ts
// ... /////
$b24 = await initializeB24Frame()
// ... /////
const makeSelectUsers = async() => {
const selectedUser = await $b24.dialog.selectUser()
$logger.info(selectedUser)
}
selectUsers
ts
async selectUsers(): Promise<SelectedUser[]>
Displays a standard dialog for selecting multiple users.
Shows only company employees.
Returns a Promise
that resolves to an array of SelectedUser
objects.
ts
// ... /////
$b24 = await initializeB24Frame()
// ... /////
const makeSelectUsers = async() => {
const selectedUsers = await $b24.dialog.selectUsers()
const list = selectedUsers.map((row: SelectedUser): string => {
return [ `[id: ${row.id}]`, row.name ].join(' ')
})
$logger.info(selectedUsers, list)
}
Data Types
SelectedUser
Used to represent information about a selected user in the Bitrix24 application. It contains several fields that describe the user's ID, name, photo, position, and other characteristics.
The
sub
andsup
fields help determine hierarchical relationships between the current user and the selected user.
id: NumberString
: User identifier. Represented as a string containing a numeric value.name: string
: Formatted name of the user.photo: string
: URL of the user's photo.position: string
: User's position in the company.url: string
: URL of the user's profile.sub: boolean
: Flag indicating that the selected user is a subordinate of the current user. A value oftrue
means the user is a subordinate.sup: boolean
: Flag indicating that the selected user is a supervisor of the current user. A value oftrue
means the user is a supervisor.