AddNotification

You can use this function for Optiva workflows.

Purpose

When AddNotification is called from any action, an entry is made in the Notification table for the field in the call to have a notification.

Notifications are defined as entries in the Message Code feature of Optiva. You can create entries with multiple language support. A blank detail code defaults to HEADER. Note that any existing notification will be overwritten by the value passed in. Allowable values for severity are 0, 1, and 2. Any other value will throw an Argument Exception.

To learn more about message codes, see the Infor CloudSuite PLM for Process Application Configuration Guide.

Note: There are optional parameters for symbol, object and detailCode. rowKey is reserved for future use.

Syntax

Public Function AddNotification(messageCode as String, propertyName As String, severity as int, Optional objSymbol As String = “”, Optional objectKey As String = “”, Optional detailCode as String = “”,  Optional rowkey As String = “”) as Long

Arguments

Argument Description
messageCode The customer assigned message code.
propertyName Holds the property name or field name
severity An Optiva defined enum of possible severity levels:
  • 0 = Notification
  • 1 = Warning
  • 2 = Critical
Optional objSymbol

The data object type or the current object type if blank.

Optional objectKey

The data object key or the current object key if blank.

detailCode

The system detail code that is used to return the new row.

Optional rowKey This is reserved for future use.

Add Test Example

In this test, assume that 3 new message codes have been created:
  • C_INFO01
  • C_WARN01
  • C_ERR01
Specify notification text for the message codes.

If you add the following code to a workflow action, it will set Notifications on the Description, Class and Approval Code fields. If one or more of those fields doesn’t exist on the particular Symbol you are testing, an error message is displayed.

AddNotification("C_INFO01", "DESCRIPTION", 0)
    AddNotification("C_WARN01", "CLASS", 1)
    AddNotification("C_ERR01", "APPROVALCODE", 2)
    Return 111