Predefined Transaction Notifications

The 'Predefined Transaction Notifications' are Notifications associated with transactions, that are defined in a generic way in WorkWithPlus for Web Settings. So, if want to have a Notification that will apply to more than one transaction, you just define it once.

Importing the notifications and subscriptions module creates some predefined notifications for transactions.

These are:

  • Discussion (only when you have the 'Discussions' module also enabled)
  • Mention (only when you have the 'Discussions' module also enabled)
  • InsertRecord: will notify the subscribed end-users when a new record is inserted in the transactions that have enabled this predefined transaction notification
  • UpdateRecord: this notification by default applies to a specific record and not to the list. So, it will notify end-users when the specific record that he is subscribed to was modified.
  • DeleteRecord: It is analogous to the 'Update Record' but when deleting some specific record.

By default 'InsertRecord', 'UpdateRecord', and 'DeleteRecord' are imported, but they are not included in transactions (as they have the property 'Behavior if Notification is not present on the instance' as False). To include them for all transactions that have WorkWithPlus for Web applied, you must change the property 'Behavior if Notification is not present on Instance' to True. If not, you can open only the transactions that you want to add these notifications (if they are a few), create a Predefined notification, and set the property 'Include' to true.

As you will be making changes in WorkWithPlus Settings, to apply the changes you will have to do 'Apply all instances' (it is suggested automatically when saving the Settings)
And then it will be necessary to impact the changes from WorkWithPlus Menu > for Web > Impact metadata for the notifications to be created on the database. As it was explained before, you will have to do the same every time a change is made in the WorkWithPlus for Web Settings > Notifications. The subscriptions necessary to receive the notifications will be added in the View tab of the transaction's instance, or in the List (depending on the property 'Applies to') as a Standard Action (Subscriptions).

Discussion and Mention notifications are triggered manually after creating new discussion messages and new threads (this is already added in the Web Panel associated with the components of the discussion). But these two notifications already have the property 'Behavior if Notification is not present on instance' as true, so they will be automatically included in all transactions that have WorkWithPlus for Web applied.

TOCNotificationsAndSubscriptionsImg008

  Property  
Notification Name NotificationsModuleImg001
Behavior if Notification is not present on the instance
Subscription description
Allow User Subscription
Applies To
Trigger Triggered
Default Visualization Icon
Title
Short Description
Long Description
Link
Advanced Security Security Functionality Key

 

Notification

Name

This property is used to identify the node in the Update Instances process.

Behavior Notification is not present on instance

If the notifications are not present in the transaction, do not include or include.

Subscription description

The description that will be displayed to the end-user or administrator at runtime in order to subscribe to this notification.

TOCNotificationsAndSubscriptionsImg0011

 

Allow User Subscription

End-user will be able to subscribe/unsubscribe to the notification or not.

Applies To

Two possible values:

  1. Any record
  • The user will be notified when a change is made to any record of the transaction. The subscription to this notification will be in the list object of the transaction that is related.
  1. Specific record
  • The user subscribes to a specific record and will be notified only when the trigger is executed on a specific record. The subscription to this notification will be in the View of the transaction that is related.

Trigger

Triggered

How the notification will be triggered (automatically in the 'After Trn' event or manual in an event or source)

Two possible values:

  1. Manual: GeneXus developer just need to add the code to send the notification, and the rest is done by WorkWithPlus for Web
  2. After insert, update, or delete
    • If this option is chosen, the 'Mode' and 'Extra condition' properties will be visible.
      TOCNotificationsAndSubscriptionsImg0012
      • Mode: If insert, update, or delete, the notification will be sent when the event occurs (together with the 'ExtraCondition' condition).
      • Extra Condition: Condition that will determine when the notification will be sent.

Default Visualization

Icon

Default icon to be displayed when receiving a notification of this type.

Title

Default title expression to be displayed when receiving a notification of this type. To set a literal, it is necessary to add the  quotes(i.e.: 'Title')

Short Description

Default description to be displayed in desktop notifications and SMS when receiving a notification of this type.

Long Description

Default description to be displayed in mail notifications when receiving a notification of this type.

Link

Default link to be included when receiving a notification of this type.

Advanced Security

Security Functionality Key

The Security Functionality Key used to check if the user has permission to subscribe to this notification.

Trigger the Notification

When the Notification that you have created is triggered manual (property 'Trigger' with the value 'Manual'), the code that you have to add in order to trigger it is the following:

WWP_SendNotification(!"<Name>", "<Category>", '<RecordId>', !"<Icon>", "<Title>", "<ShortDescription>", "<LongDescription>", <Link>, '', '', <DoCommit>)  
  • <Name> is the name of the Notification
  • <Category> is the name of the Transaction
  • When the property 'Applies to' has the value 'Specific Record', you need to send the values of the PK of the transaction. In the case of a compound PK, you separate each value by commas. If the property 'Applies to' has the value 'Any record', you set empty to <Category> value.
  • The parameters <Icon>, <Title> can be sent empty and will take their value from the definition of the Notification in the Node.
  • <ShortDescription> is the message that will be displayed in Desktop Notifications and SMS
  • <LongDescription> is the message that will be displayed when receiving a notification by email
  • <Link> is the link that will be called when clicking in a notification (from the Email, bell at the top of the page, or from a desktop notification)