ClearNotifications

You can use the ClearNotifications function to remove notifications from objects in Optiva workflows.

Note: This function is useful for cleaning up notifications after they've been modified or after certain conditions are met.

When to use

You can use this function to:

  • Clear pending notifications when a workflow action is completed, approved, or rejected to remove alerts.
  • Remove notifications when object status changes make them irrelevant (for example, clear "pending review" when approved).
  • Clean up task-related notifications after users complete the assigned tasks or actions.

When not to use

You cannot use this function to:

  • Clear notifications for issues that still require attention or have not been addressed.
  • Clear notifications when notification history is required for compliance, audit, or regulatory documentation purposes.

Syntax

long ClearNotifications(string objSymbol = "", string objectKey = "", string detailCode = "", string rowkey = "");

Parameters

Parameter Type Required Description
objSymbol string Optional

The symbol of the object.

Note: You can use empty quotation marks ("") for the current workflow symbol.
objKey string Optional

The key of the object.

Note: You can use empty quotation marks ("") for the current workflow symbol.
DtlCodes string Yes The specific detail code of the notification to clear.
Note: If the value is empty, all notifications are cleared.
rowkey string Yes The specific row key of the notification.
Note: If the value is empty, all notifications are cleared.

Return Value

The application returns a value greater than zero (0) if the operation is successful.

Impact

You must ensure clearing the notifications does not violate audit or compliance requirements.

Prerequisites

All the parameters are optional. If no parameters are supplied, the function clears all notifications from the current object.

Examples

Example 1
Clear All Notifications from Current Object
ClearNotifications();
Example 2
Clear Notifications for Specific Object
long result = ClearNotifications("ITEM", "SPICE");
Example 3
Clear Specific Notification Type
ClearNotifications("FORMULA", "F-123", "PENDING_APPROVAL");
Example 4
Clear Specific Notification Instance
ClearNotifications("PROJECT", "PRJ-001", "OVERDUE", "ROW123");