Notification
The Notification definition enables developers to configure how notifications are created, displayed, and interacted within the system. This framework allows you to:
- Define custom notifications.
- Raise notifications programmatically.
- Manage user interactions (snooze, dismiss, persist).
- Track notification state across companies and application sessions.
The attributes of Notification definition allow for greater flexibility in how and when notifications are triggered.
Key Behavior:
- If the base frequency attribute is present then the notification behaves like a Right Button, appearing consistently based on the defined frequency.
- If the base frequency attribute is not present, the notification uses the extended attributes described below to determine its behaviour and display conditions.
Syntax
[Notification: <Definition Name>]
Where, <Definition Name> is the name of the notification.
Example:
[Notification : My Custom Alert]
➥ Click here to download Notification Sample
Attributes
When a notification appears, the first thing a user needs to understand is what it is about. The Activity Name attribute serves exactly this purpose by defining the title of the notification. It is displayed prominently in the notification report and helps users quickly identify the nature of the alert such as outstanding tasks, configuration changes, or reminders. Since a notification without a clear identity would be confusing and meaningless to the user, this attribute is mandatory for every Notification definition.
Syntax
[Notification: <Definition Name>]
Activity Name : <Notification Display Name >
Where,
<Notification Display Name > is the display name or activity name for the notification report.
Example
[Notification: TSPL Notification]
Activity Name : “All Sales Order Outstanding”
Activity ID : 100001
Activity Desc : “Company Level Notification”
In this example, a notification named TSPL Notification is defined with key attributes that uniquely identify and describe it. The Activity Name specifies the title of the notification as “All Sales Order Outstanding”, which indicates the subject of the alert shown to users. The Activity ID assigns a unique numeric identifier (100001) to the notification, helping the system distinguish it from other notifications. The Activity Desc provides a brief, user-friendly description “Company Level Notification” which helps users understand the purpose and scope of the notification when managing notification settings.
Behind every visible notification, the system needs a reliable way to uniquely identify it. The Activity ID attribute assigns a unique numeric identifier to each notification type. This ID allows Tally to distinguish between different notifications, manage their lifecycle, and apply rules such as grouping, replacement, or deletion correctly. Providing a unique Activity ID is essential to avoid conflicts and ensure predictable notification behavior.
Syntax
[Notification: <Definition Name>]
Activity ID : < ID Number>
Where,
<ID number> is the identification number for the activity ID.
Example
[Notification: TSPL Notification]
Activity Name : “All Sales Order Outstanding”
Activity ID : 100001
Activity Desc : “Company Level Notification”
Users often need a little more context than just a title. The Activity Desc attribute provides a short, user-friendly description that appears in the Allow/Disallow Notifications from Customizations report. It helps users clearly understand the purpose and scope of the notification before deciding whether to allow or disallow it. Since this description plays a key role in informed user decisions, it is a mandatory attribute for Notification definitions.
Syntax
[Notification: <Definition Name>]
Activity Description: <Description Name>
Where, <Description Name> is the description used to describe the notification.
Example
[Notification: TSPL Notification]
Activity Name : “All Sales Order Outstanding”
Activity ID : 100001
Activity Desc : “Company Level Notification”
In this example, a notification named TSPL Notification is defined with key attributes that uniquely identify and describe it. The Activity Name specifies the title of the notification as “All Sales Order Outstanding”, which indicates the subject of the alert shown to users. The Activity ID assigns a unique numeric identifier (100001) to the notification, helping the system distinguish it from other notifications. The Activity Desc provides a brief, user-friendly description “Company Level Notification” which helps users understand the purpose and scope of the notification when managing notification settings.
In some cases, only the latest notification is relevant. The Delete All Previous attribute ensures that when a new notification of a given activity is raised, all earlier notifications of the same type are removed first. This prevents clutter and guarantees that users see only the most recent and relevant alert. If notifications are grouped, this attribute is ignored.
Syntax
[Notification: <Definition Name>]
Delete All Previous: <Logical Condition>
Where, <Logical condition> is an expression that evaluates to a logical value (Yes/No).
Example
[Notification: TSPL Notification]
Activity Name : “All Sales Order Outstanding”
Activity ID : 100001
Activity Desc : “Company Level Notification”
Delete All Previous : Yes
In this example, a notification named TSPL Notification is defined for “All Sales Order Outstanding”, with a unique Activity ID and a brief description indicating that it is a company-level notification. By setting Delete All Previous : Yes, the system ensures that if any earlier notifications of the same type already exist, they are removed before raising the new one. As a result, only a single, most recent notification for this activity is maintained in the notification list.
This attribute is specified to check whether the notification to be displayed at company level or application level. The default value of this attribute is Yes, i.e., at company level.
Syntax
[Notification: <Definition Name>]
IsCompanyNotify: <Logical Expression>
Where,
<Logical Expression> can be any expression which evaluates to a logical value.
Example
[Notification: TSPL Notification]
Activity Name : “All Sales Order Outstanding”
Activity ID : 100001
Activity Desc : “Company Level Notification”
IsCompanyNotif : Yes
In this example, a notification named TSPL Notification is defined to alert users about “All Sales Order Outstanding”. The Activity ID uniquely identifies this notification, while the Activity Desc provides a short description indicating its purpose. By setting IsCompanyNotif : Yes, the notification is marked as a company-level notification, meaning it applies only to the currently selected company and not across the entire application.
- If the selected action is “No Action” – The notification can remain unchanged
- If the selected action is ” Mark as Read” – The status of the notification gets updated as Mark as Read
- If the selected action is “Dismiss” – The action is to dismiss the notification from the list
- If the selected action is “Acted” – This action indicates that the required action has been completed
- If the selected action is “Snooze” – This is used when a notification needs to be snoozed so that it temporarily disappears and reappears at a later time.
This attribute enables interactive notification handling and allows developers to control notification behavior dynamically based on user actions.
Syntax
[Notification: <Definition Name>]
Handler: <Function Name>
Where,
<Function Name> is the name of the TDL function.
Example
[Notification: TSPL Printer Config Notification]
Activity Name : “Printer Setting Changed”
Activity ID : 100002
Activity Desc : “Application Level Notification”
Handler : TSPLNotificationPrinterHandler
[Function: TSPLNotificationPrinterHandler]
100 : Query Box : “Printer Settings Changed!! \n Do you wish to view the settings? ” : Yes:No
110 : If : $$LastResult
200 : Display : Change Printer
300 : End If
The Type attribute defines how users are allowed to interact with a notification. Supported notification types include Normal, Non-Dismissible, No-Read, and No-Read-No-Dismiss, each controlling whether the notification can be marked as read or dismissed. If this attribute is not explicitly defined, the notification defaults to the Normal type, allowing standard read and dismiss actions.
Syntax
[Notification: <Definition Name>]
Type: <Notification Type>
Where,
<Notification Type> can be any of the following values: Normal, Non-Dismissible, No-read, No-read-no-dismiss.
Example
[Notification: TSPL Notification]
Activity Name : “All Sales Order Outstanding”
Activity ID : 100001
Activity Desc : “Company Level Notification”
IsCompanyNotif : Yes
Handler : TSPLNotificationHandler
Persist : Yes
Type : Normal
The Persist attribute determines whether a notification should be temporarily held in memory or saved across sessions. When the notification is in-memory, it remains visible only while TallyPrime is running and is cleared once the application is closed. When Persist is enabled, the notification is stored and continues to appear in the Notification Report even after TallyPrime is closed and restarted. This attribute helps control the lifespan of notifications based on their importance and relevance.
Syntax
[Notification: <Definition Name>]
Persist: <Logical Value>
Where,
<Logical Value> can be any expression which evaluates to logical value.
Example
[Notification: TSPL Notification]
Activity Name : “All Sales Order Outstanding”
Activity ID : 100001
Activity Desc : “Company Level Notification”
IsCompanyNotif : Yes
Handler : TSPLNotificationHandler
Persist : Yes
In this example, Persist is set to Yes which ensures that the notification is saved across sessions, meaning it will continue to appear in the Notification Report even after TallyPrime is closed and restarted.
Users often want to postpone notifications rather than dismiss them entirely. The Snooze Type attribute defines how long a notification remains snoozed before reappearing. Supported values include Next Reminder Date, where the notification resurfaces based on a configured reminder, and Next Product Release, where it reappears after a product update. This attribute controls the snooze behavior at a conceptual level.
Syntax
[Notification: <Definition Name>]
Snooze Type : <Next reminder date/Next product release>
Where, <Next reminder date/Next product release> specifies the duration for when the notification should reappear.
Example
[Notification: TSPL Notification]
Activity Name : “All Sales Order Outstanding”
Activity ID : 100001
Activity Desc : “Company Level Notification”
IsCompanyNotif : Yes
Handler : TSPLNotificationHandler
Persist : Yes
Snooze Type : Next reminder Date
When the snooze behavior depends on a reminder date, the Snooze Value attribute becomes mandatory. It specifies the duration for which the notification should remain snoozed. This attribute is valid only when Snooze Type is set to Next Reminder Date and is ignored otherwise. Together, Snooze Type and Snooze Value allow fine-grained control over notification postponement.
Syntax
[Notification: <Definition Name>]
Snooze Value : <Snooze Duration>
Where, <Snooze Duration> specifies number of seconds which takes a unique value and it must be a positive long integer.
Example
[Notification: TSPL Notification]
Activity Name : “All Sales Order Outstanding”
Activity ID : 100001
Activity Desc : “Company Level Notification”
IsCompanyNotif : Yes
Handler : TSPLNotificationHandler
Persist : Yes
Snooze Type : Next reminder Date
Snooze Value : 30
The Raise New attribute specifies whether a new notification instance should be created when a notification of the same activity already exists in the Notification Report. It accepts a logical value (Yes/No). When set to Yes, a new notification is raised even if an existing one is present; when set to No, no additional notification is created. This behavior is different from grouped notifications, where a single notification is retained and only its timestamp is updated whenever the activity occurs again. If Grouped is set to Yes, the Raise New attribute is ignored, as grouping takes precedence in handling repeated notifications.
Syntax
[Notification: <Definition Name>]
Raise New : <Logical Condition>
Where, <Logical Condition> is an expression that evaluates to a logical value (Yes/No).
Example
[Notification: TSPL Notification]
Activity Name : “All Sales Order Outstanding”
Activity ID : 100001
Activity Desc : “Company Level Notification”
IsCompanyNotif : Yes
Raise New : Yes
In this example, Raise New : Yes specifies that a new notification instance should be created every time the “All Sales Order Outstanding” activity occurs, even if an earlier notification of the same type already exists in the Notification Report. This allows multiple occurrences of the same activity to be tracked separately, rather than reusing or updating an existing notification.
The Expiry Relative attribute determines whether a notification’s expiry is relative or absolute. A relative expiry means the notification expires based on a duration calculated from when it is raised. An absolute expiry means the notification expires at a fixed date and time, independent of other notifications or events. This attribute helps define the lifecycle model for notifications.
Syntax
[Notification: <Definition Name>]
Expiry Relative : <Logical Condition>
Where, <Logical Condition> is an expression that evaluates to a logical value (Yes/No).
Example
[Notification: TSPL Notification]
Activity Name : “All Sales Order Outstanding”
Activity ID : 100001
Activity Desc : “Company Level Notification”
Expiry Relative : Yes
Expiry Duration : 3 : Days
In this example, the notification TSPL Notification is configured with Expiry Relative : Yes, which means the notification’s expiry is calculated relative to the time it is raised, rather than based on a fixed date and time. The Expiry Duration : 3 : Days specifies that the notification will automatically expire two days after it is generated. This setup is useful for time-bound reminders where expiry depends on when the notification is created.
For notifications that must expire at a precise moment, the Expiry Date Time attribute is used. It specifies the exact date and time when the notification should expire and is mandatory when Expiry Relative is set to No. If this attribute is missing in such cases, the expiry configuration is considered invalid. This is ideal for deadline-driven or compliance-related notifications.
Syntax
[Notification: <Definition Name>]
Expiry Date Time : <Date and Time>
Where, <Date and Time> specifies the absolute date and time for the notification to expire.
Example
[Notification: TSPL Notification]
Activity Name : “All Sales Order Outstanding”
Activity ID : 100001
Activity Desc : “Company Level Notification”
Expiry Relative : No
Expiry Date Time : 23-02-2026
In this example, the notification TSPL Notification is configured with Expiry Relative: No, which means its expiry is absolute and not dependent on when the notification is raised. The Expiry Date Time attribute specifies the exact date and time, 23rd March 2026, after which the notification will automatically expire and no longer be visible to users. This approach is suitable for deadline-driven alerts that must expire at a fixed point in time.
When expiry is relative, the Expiry Duration attribute specifies how long the notification should remain valid after it is raised. The duration can be expressed in units such as days, weeks, hours, minutes, or seconds, with days being the default. If this attribute is not provided, relative expiry is ignored. This allows developers to define time-bound reminders that automatically clean themselves up.
Syntax
[Notification: <Definition Name>]
Expiry Duration : <Duration>
Where, <Duration> specifies the expiry duration that will be calculated from the time the notification is raised.
Example
[Notification: TSPL Notification]
Activity Name : “All Sales Order Outstanding”
Activity ID : 100001
Activity Desc : “Company Level Notification”
Expiry Relative : Yes
Expiry Duration : 3 : Days
In this example, a notification named TSPL Notification is defined to alert users about “All Sales Order Outstanding”, with a unique Activity ID and a brief description indicating that it is a company-level notification. The Expiry Duration : 3 : Days attribute specifies that the notification should automatically expire three days after it is raised. This means the notification will no longer appear to users once the defined duration has elapsed, provided the expiry is configured as relative.
