System
System definitions are used to define elements that are available globally across TallyPrime. They are created at the system level and can be accessed by multiple reports and definitions. System definitions can be defined multiple times in TDL, with the items specified in each definition being added to the existing system-level configuration.
The commonly used System definitions include Formula, Form Keys, Menu Keys, TDL Names, UDF, Variable, and Events.
Syntax
[System : <System Definition Type>]
<Attribute> : <Value>
- <System Definition Type> → Specifies the type of system-level definition being created, such as Formula, Variable, UDF, or Events.
- <Attribute> → Specifies the item being defined under the selected System definition.
- <Value> → Specifies the value, expression, or configuration associated with the item.
System Events are used to associate an action with a system-level event. The specified action is triggered when the event occurs and its condition is satisfied. Supported system events include events such as System Start, System End, Load Company, and Close Company.
Syntax
[System : Events]
<Event Name> : <Event> : <Logical Condition> : <Action> : <Action Parameter>
Example
[System : Events]
TSPLCompanyLoad : Load Company : Yes : Display : TSPL Report
This example defines an event named TSPLCompanyLoad. Whenever a company is loaded and the condition evaluates to Yes, the TSPL Report is displayed.
System Form Keys are used to associate commonly required keys with Form-related actions. Once a key is included in System Form Keys, it becomes available by default to the relevant forms.
Syntax
[System : Form Keys]
Key : <Key Name>
Example
[System : Form Keys]
Key : Form Accept
Key : Form Reject
This example associates the Form Accept and Form Reject keys at the system level. These keys are therefore available to forms without requiring them to be individually associated with every Form definition.
System Formula is used to define formulas at the system level. These formulas are globally available and can be reused across different TDL definitions using the @@ prefix.
Syntax
[System : Formula]
<Formula Name> : <Expression>
Example
[System : Formula]
TSPLReportTitle : “TSPL Report”
This example defines a global formula named TSPLReportTitle with the value “TSPL Report”. The formula can be reused in other definitions using @@TSPLReportTitle.
System Menu Keys are used to associate commonly required keys with Menu-related actions. The keys defined here are available to Menu definitions by default.
Syntax
[System : Menu Keys]
Key : <Key Name>
Example
[System : Menu Keys]
Key : Menu Up
Key : Menu Down
Key : Menu Reject
This example makes the Menu Up, Menu Down, and Menu Reject keys available to menus by default, allowing common menu navigation actions to be used without defining them separately for each menu.
System TDL Names are used to define frequently used business keywords or strings with an identifier. The value can then be reused wherever the corresponding system name is required. TDL Names can also help in scenarios involving multilingual support.
Syntax
[System : TDL Names]
<Name Identifier> : <String Value>
Example
[System : TDL Names]
TSPLReportName : “TSPL Report”
This example defines TSPLReportName as a system name for the string “TSPL Report”. The defined name can be reused wherever the corresponding TDL Name is required.
System UDF is used to create additional storage for storing information that is not available in the predefined TallyPrime object structure. A UDF is associated with the current object when it is used as storage.
Syntax
[System : UDF]
<UDF Name> : <Data Type> : <Index Number>
Example
[System : UDF]
TSPLRemark : String : 20003
This example creates a UDF named TSPLRemark of type String with index 20003. The UDF can be used to store additional text information against the relevant object.
System Variable is used to declare variables at the system scope. A system-level variable is available across reports and retains its value during the TallyPrime session.
Syntax
[System : Variable]
<Variable Name> : <Initial Value>
Example
[System : Variable]
TSPLStatus : “Active”
This example defines a system variable named TSPLStatus with the initial value “Active”. Since it is declared at system scope, the variable can be accessed across reports.
