Skip to main content

1E 8.1 (on-premises)

Interaction.ShowAnnouncement

Module

Interaction

Method

ShowAnnouncement

Library

Core

Action

Displays a pop-up announcement to one or more user sessions.

Parameters

Name (string): Text that will appear when the pop-up announcement is displayed.

Description (string): Description text that will appear when the announcement is displayed. Supports "\n" as line break line.

Async (bool): Whether to run the method synchronously or asynchronously..

In synchronous mode (false), the method will return a table of results once all user sessions have responded or have timed out.

In asynchronous mode (true), the method returns immediately and results will appear as events as user sessions respond or timeout.

See also Topic.

Icon (string, optional): Image/icon to identify who is sending the announcement. Can be a URL or Data URL.

From (string, optional): Name and/or e-mail of who is sending the announcement. Supports "\n" as line break line.

FromDesignation (string, optional): Title or position of who is sending the announcement. Supports "\n" as line break.

Can only be specified if From is given.

Choices (table, optional): A table of ordered buttons to be displayed as part of this announcement.

The table consists of rows of Text, and Action strings. The Text value will be used as the button label. If the Action value is an URL, a new browser window will be opened. The order of the choices determines the right to left order of buttons.

ShowDefaultButtons (bool, optional; default true): Whether to show or hide default buttons ("Later" and "Dismiss").

TimeoutSeconds (integer, optional, default 60): The number of seconds before the announcement will timeout.

Minimum of 30 seconds, maximum of 900 seconds.

Topic (string): In asynchronous mode, the name of the event that will be raised when a user response is obtained. In synchronous mode, this is not relevant and should not be supplied.

UserName (string, optional): Username of the logon session to which this announcement should be directed.

If Username is not supplied then the announcement will be directed to all active user sessions.

Link (string, optional): A URL which will appear as a 'Click here to find out more' link within the announcement.

Footer (string, optional): Extra explanatory text to display.

HighPriority (bool, optional, default false): Whether to display immediately.

Return values

Response (string): Text of the button selected by the user.

ResponseTimeSeconds (integer): Number of elapsed seconds before the user responded or before the request timed out.

ResponseType (string): Indicates whether the user responded or whether the user failed to respond before the announcement timed out.

ResponseValue (bool): true if the positive choice was selected else false if for the negative choice.

SessionId (integer): Id of the user session associated with this announcement response.

UserName (string): Username of the logon session associated with this announcement response.

Example

@choices = SELECT "I'll be there" AS Text, "go" AS Action
           UNION ALL
           SELECT "No thanks" AS Text, "nogo" AS Action;
Interaction.ShowAnnouncement(Async: false, Name:"Restaurant suggestion", Description: "Eat at Joe's", Choices: @choices, From: "Big Joe", Footer: "Bring a bottle");

Tip

The order of @choices determines the right to left order of buttons. In the above example, UNION ALL causes the set to stay in order written, and not be sorted by SQL.

Platforms

  • Windows

Notes