The Transaction Notifications are associated with one transaction, can be triggered manually or automatically, and the end-user will be able to subscribe to it in the List or in the View of that transaction (depending on the definition of the Notification). When you have a Transaction Notification that you want to include in several Transactions (each one with its own data of course), you can use the 'Predefined Transaction Notifications' to define them just once.
When you insert one Transaction Notification, you will define whether it will be a 'Predefined Transaction Notification' (these are the ones configured in WorkWithPlus for Web Settings), or define a Custom Notification.
In the following example, we create a Custom Notification for Invoice Transaction, that will be triggered automatically when an invoice of amount > 1000 is created, updated or deleted:
At runtime, the end-users will have to subscribe to the notification, and then will receive the notification when the condition is accomplished:
The following image displays another example of a Custom Notification triggered automatically, only for Update mode and in the 'Extra condition' uses the Old function (in order to compare with the previous value saved in DB)
As for a Predefined Notification, you will select one from the ones created in WorkWithPlus for Web Settings > Transaction Predefined Notifications:
In this case, the property 'Include notification' will appear and specifies whether to include the notification to this transaction or not. This is because you can have a 'Predefined Transaction Notification' that applies for most of the transactions, so you create the node in the transactions that you don't want and set 'Include notification' as false. Or vice-versa, you want it just in a few transactions (but don't want to duplicate the notification definition many times), so you define it in the 'Predefined Transaction Notification' with the property 'Behavior if notification is not present on instance' as False, and you set the property 'Include' of the specific Transaction Notification as 'True'.
All the other properties, if you leave the value <default> will take its value from the associated 'Predefined Transaction 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)
|