Notification formulas

The Providers node under the NOTIFICATIONS node in the Hansen8 configuration can have up to four children: Email, Formula, Twilio, and a custom provider. The Formula provider uses a workflow formula in Infor Public Sector to send notifications.

To define provider formulas, use the Notify event of the Resources.Notification object in the Workflow Manager. For example, this formula sends an email when a work order is created:

'Use this formula to send the Notification when creating the work order
'The parameters passed in include: Email address,Subject line, and body of the message

return Hansen.Core.EMail.SendMail("address@agency.com", "Notification Formula Called", 
"A formula was called by the notification type " & message.NotificationType.Code)

You can also use other workflow formulas to send notifications. For example, this formula is defined for the AfterAdd event of the WorkOrder object. It sends a notification of the specified type (WOASSIGNFL in this case) to inform the assigned employee after a work order is added. The notification type must be defined using the Notification Type code definition.

'No template with custom message
'return Hansen.Resources.Notifications.NotificationService.Send("WOASSIGNFL", oWorkOrder, 
oWorkOrder.AssignedTo.Contact)

dim res as result=Hansen.Resources.Notifications.NotificationService.Send("WOASSIGNFL", oWorkOrder, 
oWorkOrder.AssignedTo.Contact)

return new result(0, resultseverity.UserWarning, "Return code is: " & res.code)
Note: The Formula Editor includes some code snippets to assist you in writing notification formulas. The snippets can be found under Resources > Notifications.