⟵ hearthere ⟶

Notifications

The simplest way to add a notification is to use the notificationSend function.

Notification Table and Mechanics

Notifications

  • Active from — the date-time from which the notification will be considered active.

  • Title — internal technical title, not displayed to the user.

  • Userid of the user for whom the notification is intended.

  • Code — a string in the notification codes table defining the type of notification.

  • Parameters — parameters passed for a specific notification.

  • Active — indicator of the notification's activity.

  • Priority — the priority of displaying the notification if the user has several. If the priority is the same, the notifications will be displayed in ascending order of their id.

    Notification priority 1 > 10. The smaller the number, the higher the priority.

Notification Codes

Defines the type of notification.

  • Name — internal name of the notification type.

  • Code Name — unique name of the notification type, by which it will be called.

  • Code — the action code of the notification. The result of the functions should be returned from the =: section:

Adding a Notification

To add a notification, you need to add a row to the notifications table:

=: insert(table: 'notifications'; field: 'code' = "tmp_text"; field: 'active_dt_from' = $#ndt; field: 'title' = "Notification title to be shown in the latest notifications table"; field: 'user_id' = 1; field: 'vars' = $vars; field: 'active' = true)
vars: rowCreate(field: "title" = "Notification title"; field: "text" = "Notification text")

Code tmp_text in notification codes:

=: linkTodataText(title: $#title; text: $#text)

Notification as a Temporary Table

To add a notification as a table, in notification codes it should be called through linkTodataTable:

notification as a table

=: linkToDataTable(table: 'tmp_table'; title: "Notification title"; height: 400; params: $row; data: $data)

row: rowCreate(field: "h_test" = $#val)

data: rowListCreate(field: "goods" = $#goods; field: 'count' = $#count)

Notification Check Time

The parameter is set in System TablesMainSettings and CronSettingsNotification Check Frequency.

Specified in seconds. If the parameter is empty, notifications are not checked.