Click Reaction

ActionDto — the action defines the reaction to a click on a specific timeline record element. There are several different types of actions, each with its own format.

If a relative link to standard Bitrix24 objects that support opening in a slider is used, the slider will be displayed. Otherwise, it will be a regular link navigation.

Parameters

Required parameters are marked with *

Field

Description

type*
const

Value redirect

uri
string

Valid URI link, for example https://example.com or /crm/deal/details/1/

Example

{
            "type": "redirect",
            "uri": "/crm/deal/details/1/"
        }
        

Event

Calling the action will generate the event onCrmTimelineItemAction. When the event occurs, handlers will be triggered only for the application that created this timeline record. The context will always be passed to the handler:

  • id - event identifier,
  • entityTypeId - identifier of the object type to which the deal is linked,
  • entityId - identifier of the element of this object,
  • activityId - identifier of the deal,
  • userId - identifier of the user who triggered the action.

Parameters

Required parameters are marked with *

Field

Description

type*
const

Value restEvent

id*
string

Event identifier. Any value can be specified, for example resetButtonClick

actionParams
array

Array of arbitrary format, the data from which will be passed to the event handler

animationType
string

Animation that will be shown during event processing, for example disable

In some cases, sending the event implies that the handler of this event should change the appearance of the record in the timeline. For example, adding new blocks or changing the set of buttons.

To ensure the user sees the update, the animationType parameter can be used. If animationType is set to loader — the timeline record will be blocked and a loader will appear on top of it. The blocking will last until the record is updated via crm.activity.configurable.update.
If the action is triggered by clicking a button at the bottom of the timeline and animationType is set to disable — this button will be blocked until the record is updated via crm.activity.configurable.update.

Example

{
            "type": "restEvent",
            "id": "resetButtonClick",
            "actionParams": {
                "myId": 123,
                "someImportant": "qwerty"
            },
            "animationType": "disable"
        }
        

The action is assigned to a button. Clicking it will trigger the event handler onCrmTimelineItemAction, registered by the application that created the timeline record.
The standard parameters id=resetButtonClick, entityTypeId, entityId, activityId, userId and the parameters defined by the developer — myId=123 and someImportant=qwerty will be passed to the handler. The button will be blocked from the moment it is clicked until the timeline record is updated via crm.activity.configurable.update.

Opening the Application Slider

Warning

The action is not supported in the mobile application.

Calling the action will open the slider of the application that created the timeline record. The context will be passed to the slider:

  • entityTypeId - identifier of the object type to which the deal is linked,
  • entityId - identifier of the element of this object,
  • activityId - identifier of the deal.

Parameters

Required parameters are marked with *

Field

Description

type*
const

Value openRestApp

actionParams
array

Array of arbitrary format, the data from which will be passed to the event handler

sliderParams
ActionSliderParamsDto

Options with which the slider is opened

Example

{
            "type": "openRestApp",
            "actionParams": {
                "myId": 123,
                "someImportant": "qwerty"
            },
            "sliderParams": {
                "title": "This is the application slider title",
                "width": 700
            }
        }
        

ActionSliderParamsDto

Parameters for Opening the Application Slider

Field

Description

Additional

width
int

Width of the slider, px

Cannot be used simultaneously with leftBoundary

leftBoundary
int

Slider spans the full width of the browser window with a left margin, px

Cannot be used simultaneously with width

title
string

Text of the browser window title when opening the slider

Continue Exploring