Notification formulas

A formula provider uses a workflow formula 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 a notification when creating a 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.

'Send notification of type "WOASSIGNFL" with a specified message.

return Hansen.Resources.Notifications.NotificationService.Send("This is the message", 
"WOASSIGNFL", oWorkOrder, oWorkOrder.AssignedTo.Contact)
Note: The Formula Editor includes some code snippets to assist you in writing notification formulas. The snippets can be found under Resources > Notifications.