Documentation

ActionDto

Action defines a reaction to a click on a specific timeline record item. There are several types of actions, each having its own format.

  • Click

    Shows slider menu in case of a relative link to standard Bitrix24 instance entities. Otherwise, just follows a standard link.

    Field Type Description Additional
    type const Must have redirect value Required.
    uri string URI linksFor example https://google.com or /crm/deal/details/1/

    Example

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

    Call generates a REST event onCrmTimelineItemAction. Successful event triggers handlers only for application that created this timeline record. Handler always receives context as follows:

    • id - event identifier,
    • entityTypeId - entity type identifier with associated activity,
    • entityId - this entity element identifier,
    • activityId - activity identifier,
    • userId - user identifier, that triggered the activity.

    Field Type Description Additional
    type const Must have restEvent valueRequired.
    id string Event identifier. Can specify any convenient value.Required
    actionParams array Array with arbitrary format, with data passed to event handler
    animationType string Link URLAnimation displayed when processing the event

    In some REST sending scenarios, this event should update external appearance for a timeline record, i. e. adding new blocks, modifying set of buttons and etc.

    To notify a user about the occurring processing you can use the parameter animationType. If animationType has the value loader, the timeline record will be blocked and a loader will be shown on top of it until the record is updated via crm.activity.configurable.update.

    In case the action is triggered at the button in the timeline record footer and animationType has the value disable, the corresponding button will be blocked until this record is updated using crm.activity.configurable.update.

    Example

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

    Assigning such configuration to the button triggers a REST handler for event onCrmTimelineItemAction, registered by the application that created the timeline record.

    Handler receives parameters id=resetButtonClick, entityTypeId, entityId, activityId, userId, as well as myId=123 and someImportant=qwerty parameters directly defined by developer.

    Button will be blocked from the moment of button click and to the moment of timeline update using crm.activity.configurable.update.

  • Open app details window

    Action isn't supported in the mobile application.

    Calling an action to open app slider, creates this timeline record. Passes the following context to slider:

    • entityTypeId - entity type ID with associated activity,
    • entityId - this entity element ID,
    • activityId - activity ID.

    Field Type Description Additional
    type const Must have openRestApp valueRequired.
    actionParams array Array with arbitrary format with data passed to the event handler
    sliderParams ActionSliderParamsDto Parameters for opened app window

    Example

    {
    	"type": "openRestApp",
    	"actionParams": {
    		"myId": 123,
    		"someImportant": "qwerty"
    	},
    	"sliderParams": {
    		"labelText": "this application",
    		"labelColor": "#c3b3ff",
    		"labelBgColor": "violet",
    		"title": "This is title for application slider window",
    		"width": 700
    	}
    }

    ActionSliderParamsDto

    Parameters for opening app window

    Field Type Description Additional
    width int Slider window width, pxCannot be used simultaneously with leftBoundary
    leftBoundary int Slider for a complete browser window width with left side offset, pxCannot be used simultaneously with 'width'
    labelBgColor string Background color code for button that closes slider windowCan have only the values 'aqua, green, orange, brown, pink, blue, grey, violet'
    labelColor string Slider closing button colorwith format #112233
    labelText string Text for slider closing button
    title string Text for browser window title when opening the slider



© «Bitrix24», 2001-2024