### Starting With String Operator Example Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/what-are-data-types-operators-and-expressions-in-tdl The Starting With operator (aliases Beginning With, Starting) checks if the second string operand begins with the first string operand. It returns 'Yes' if it starts with the specified string, otherwise 'No'. This example checks if 'TDL World' starts with 'TDL'. ```TDL Set As: If “TDL World” Starting with “TDL” Then “TDL” Else “World” Set As: If “TDL World” Beginning “TDL” Then “TDL” Else “World” ``` -------------------------------- ### Send GET Request with HTTP Headers (TallySolutions) Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/objects-and-collections Demonstrates sending a GET request with an 'Accept:application/json' header to receive a JSON response. It utilizes the HTTP JSON data source. ```TallySolutions [Collection: TSPL Get Employees JSON] Export Header : "Accept:application/json" Data Source : HTTP JSON: "http://localhost/ExportHeader/getempdetails.php" :UTF8 ``` -------------------------------- ### Tally Example: Handling Stock Item Deletion Events Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl Provides a practical example of implementing 'Before Delete Object' and 'After Delete Object' events for Stock Item deletions in Tally. It shows how to define event handlers and associated functions to log information during the deletion process. ```tdl [System : Event] BeforeStockItemDeletion : Before Delete Object : $$IsStockItem:Call:BeforeDeleteObjectFunc AfterStockItemDeletion : After Delete Object : $$IsStockItem:Call:AfterDeleteObjectFunc [Function : BeforeDeleteObjectFunc] 00 : Log : "Before Delete Object Event starts here" 10 : Log : $Name + "under the Stock Group" + $Parent + "is being deleted by " + $$CmpUserName 20 : Log : $MasterID 30 : Log : "Before Delete Object Event ends here" [Function : AfterDeleteObjectFunc] 00 : Log : "Stock Item " + $Name + " Deleted" ``` -------------------------------- ### Tally Definition Language: Batch Posting Example Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl This TDL code demonstrates the use of START BATCH POST and END BATCH POST actions to create a specified number of ledgers in batches. It optimizes performance by reducing database lock and release cycles compared to individual object updates. The batch size can be optionally specified. ```TDL [Function : Create Ledgers] Parameter : pNumberofLedgers : Number : 1000 000 : START BATCH POST : 500 010 : For Range : i : Number: 1: ##pNumberofLedgers 020 : New Object : Ledger 030 : Set Value : Name : "Customer " + $$String:##i 040 : Set Value : Parent : "Sundry Debtors" 050 : Create Target 060 : End For 070 : END BATCH POST ``` -------------------------------- ### Example: Full Unzip with Password Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl Demonstrates the 'Unzip' system action to extract a password-protected zip file ('D:\Target.zip') into the current Tally application folder. The password 'Tally' is provided. ```TallyScript Unzip : "." : "D:\Target.zip" : "Tally" ``` -------------------------------- ### Example: Partial Unzip with Overwrite Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl Shows the procedural actions for unzipping a file ('D:\Target.zip') to a target folder ('D:\Unzipped') and overwriting any existing files in the target location. A progress bar is not explicitly shown. ```TallyScript Start Unzip: "D:\Target.zip" End Unzip : "D:\Unzipped" : Yes ``` -------------------------------- ### Like String Operator Example Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/what-are-data-types-operators-and-expressions-in-tdl The Like operator checks if a string matches a given pattern, using '%' as a wildcard for zero or more characters. This example checks if the '$Name' variable matches a pattern ending with 'Party'. ```TDL Set As: If $Name Like “%Party” Then “Debtors” Else “Creditor” ``` -------------------------------- ### Example: Extract Specific File Types Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl Demonstrates partial unzipping using procedural actions to extract only files with '.txt' and '.doc' extensions from 'D:\Target.zip' into the current Tally application folder. ```TallyScript Start Unzip : "D:\Target.zip" Extract Path : "*.txt" Extract Path : "*.doc" End Unzip : "." ``` -------------------------------- ### Tally TDL: Example of NatLangQuery Syntax Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl Illustrates the basic syntax of the NatLangQuery system event in Tally. It shows how to define an event name, a condition to trigger the action, the action to be called, and any necessary action parameters. ```TDL [System : Event] Ledger Creation: NatLangQuery: @@IsLedgerinQuery: Call: Create Ledger ``` -------------------------------- ### Example of Passing Parameters in XML Request to Tally Source: https://help.tallysolutions.com/developer-reference/developer-reference-faq/tdl-faq This example illustrates how to pass parameters to a function within an XML request when interacting with Tally. It shows a function signature for retrieving license information. ```XML EXPORT FUNCTION $$LicenseInfo SerialNumber ``` -------------------------------- ### Example: Partial Unzip with Exclusions Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl Illustrates partial unzipping where a specific folder ('SamplesSupporting Files') is extracted from 'D:\Target.zip' to the current Tally application folder, but files with the '.xls' extension are excluded from the extraction. ```TallyScript Start Unzip : "D:\Target.zip" Extract Path : "SamplesSupporting Files" Unzip Exclude Path : "*.xls" End Unzip : "." ``` -------------------------------- ### Part Line Definition Example Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/what-is-th-overall-perspective-on-tally-technology Shows how to define the Lines contained within a Part using the 'Line' attribute (or its synonym 'Lines'). ```tally [Part : HW Part] Line : HW Line1, HW Line2 ``` -------------------------------- ### Implementing Timer Events Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl Defines a system-level timer event and the syntax for starting a timer to perform automated periodic operations. ```TDL [System : Event] MyTimer : TIMER : @@Condition : CALL : MyAction START TIMER : MyTimer : 60 ``` -------------------------------- ### Indent Syntax and Example Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/what-is-dimensions-and-formatting-in-tdl Defines the syntax for the 'Indent' attribute, which controls spacing similar to the Tab key. It can be used in Line or Field definitions and accepts a measurement formula. ```TallyScript Indent : Example: Indent : @@IndentByLevel ``` -------------------------------- ### Compute Var Attribute Example (TallySolutions) Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/objects-and-collections Demonstrates the 'Compute Var' attribute, which evaluates a variable's value based on a sub-object of the source object. It includes a conditional formula for setting the variable. ```TallySolutions Compute Var : IName:String : if ##LogVar then $StockItemName else ##LogVar ``` -------------------------------- ### Implementing WalkEx for Performance Optimization Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/objects-and-collections Demonstrates how to define a resultant collection using WalkEx to aggregate data from Ledger and StockItem details in a single pass over the VoucherSource. ```TDL [Collection: VoucherSource] Type : Voucher [Collection: Union LedStk Vouchers] Source Collection : VoucherSource WalkEx : Ledger Details, StockItem Details Keep Source : () [Collection: Ledger Details] Walk : AllLedgerEntries By : VchStockItem : $LedgerName Aggr Compute : VchLedAmount : Sum : $Amount [Collection: StockItem Details] Walk : AllInventoryEntries By : VchStockItem : $StockItemName Aggr Compute : VchLedAmount : Sum : $Amount ``` -------------------------------- ### GET Requests with Headers Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/objects-and-collections Details how to send GET requests to a server with HTTP headers. GET requests do not have a request body. The server URL is specified using Remote URL or Data Source attributes, and headers are defined using Export Header. ```APIDOC ## GET Requests with Headers ### Description Send a GET request to a server that includes HTTP headers. GET requests do not contain a request body. ### Syntax Examples **Using Remote URL:** ``` [Collection: MyCollection] Export Header: "Content-Type: application/xml\nAuthorization: Bearer mytoken" Remote URL: http://api.example.com/resource ``` **Using Data Source (HTTP XML):** ``` [Collection: MyCollection] Export Header: "Accept: application/xml" Data Source: HTTP XML : http://api.example.com/data.xml : UTF8 ``` ### Parameters - ****: The name of the collection. - ****: The URL to which the request is sent. - ****: Optional. Can be ASCII, UNICODE, UNICODE8, UTF8, or UTF16. Defaults to UTF16 for HTTP XML/JSON data sources. ``` -------------------------------- ### Create Zip Archive with Tally Procedural Actions Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl Demonstrates how to initialize a zip archive, include specific files and directories, and manage file overwriting. The process is concluded with the End Zip action. ```Tally Procedural Language Start Zip : "Target.zip" : Yes Zip Add Path : "tally.ini" End Zip ``` ```Tally Procedural Language Start Zip : "Target.zip" : Yes Zip Add Path : ".Tally.ini" Zip Add Path : "D:\\Documents\\*.doc" : Yes Zip Add Path : "C:\\Work" End Zip ``` ```Tally Procedural Language Start Zip : "Target.zip" : Yes Zip Add Path : ".Tally.ini" Zip Add Path : "D:\\Documents\\*.doc" : Yes Zip Add Path : "C:\\Work" Zip Exclude Path : "*.txt" End Zip ``` -------------------------------- ### Equals Operator Example Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/what-are-data-types-operators-and-expressions-in-tdl The Equals operator (=) returns TRUE if both operands are equal. It is used for comparison, not assignment. This example shows its usage in a formula. ```TDL Break On : $$Line = 1 My Formula : $BasicTypeOfDuty:Ledger:$LedgerName Equals + $$LocaleString:“Sales Tax” ``` -------------------------------- ### Greater Than Operator Example Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/what-are-data-types-operators-and-expressions-in-tdl The Greater Than operator (>) returns TRUE if the first operand is greater than the second operand. This example compares a line number with the total number of ledger entries. ```TDL $$Line > $$NumItems:AllLedgerEntries ``` -------------------------------- ### Fetch Object and FetchSeparator Usage Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/objects-and-collections Demonstrates how to dynamically fetch object methods at the function level and use the $$FetchSeparator function to retrieve data from multiple objects simultaneously. ```TDL [Function: FillUsingTrackingObj] Parameter :pTrackKey:String Fetch Object :Tracking Number :##pTrackKey: *.* Fetch Object: Ledger: "Debtor North" +$$FetchSeparator + "Debtor South": Name, Parent, ClosingBalance ``` -------------------------------- ### Procedural Actions: Partial Unzip with Start/End Unzip Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl These procedural actions allow for selective unzipping of files and folders from a zip archive. 'Start Unzip' initializes the process, 'Extract Path' specifies items to include, 'Unzip Exclude Path' specifies items to exclude, and 'End Unzip' defines the target location and behavior for overwriting existing files. ```TallyScript Start Unzip : [: ] Extract Path : Unzip Exclude Path : End Unzip : [: [:]] ``` -------------------------------- ### Less Than Operator Example Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/what-are-data-types-operators-and-expressions-in-tdl The Less Than operator (<) returns TRUE if the first operand is less than the second operand. This example compares a line number with the total number of ledger entries. ```TDL $$Line < $$NumItems:AllLedgerEntries ``` -------------------------------- ### Collection using Object Attribute with Format Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/objects-and-collections Demonstrates creating a collection 'CourseDetails' using programmer-defined objects ('Course1', 'Course2', 'Course3'). The 'Format' attribute specifies which method ('CourseName') to display and its width. ```TDL [Collection : CourseDetails] Objects : Course1, Course2, Course3 Format : $CourseName, 30 ``` -------------------------------- ### Optimizing Multi-Path Walking with WalkEx Source: https://help.tallysolutions.com/developer-reference/tallyprime-customisation/how-to-choose-the-right-approach-from-tdl Illustrates the use of 'WalkEx' to perform a single-pass walk over source collections. This significantly improves performance when performing unions of inventory and ledger entries. ```TDL [Collection: TSPLResultColl] Source Collection : VoucherColl WalkEx : TSPLVchInv, TSPlVchLed [Collection : TSPlVchLed] Walk : AllLedgerEntries By : Particulars : $LedgerName Aggr Compute : Tot Amount : Sum: $Amount [Collection : TSPLVchInv] Walk : AllInventoryEntries By : Particulars : $StockItemName Aggr Compute : Tot Amount : Sum: $Amount ``` -------------------------------- ### Null Operator Example Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/what-are-data-types-operators-and-expressions-in-tdl The Null operator checks if an operand is empty. It returns TRUE if the operand is empty, otherwise FALSE. This example sets a value based on whether '#Myfield' is null. ```TDL Set As: If #Myfield Null Then 200 Else 500 ``` -------------------------------- ### Filter Var Attribute Example (TallySolutions) Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/objects-and-collections Explains the 'Filter Var' attribute, used to evaluate a variable based on objects within a collection after Fetch and Compute attributes. It provides an example with a condition based on a quantity. ```TallySolutions Filter Var : Fin Obj Var : Logical : $$Number:$BilledQty > 100 ``` -------------------------------- ### Zip Multiple Text Files with Sub-directories and Progress Bar Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl This example shows how to zip all text files from a specified directory ('D:\Work') into a target ZIP file ('D:\Target.zip'). It includes files from sub-directories, sets a password ('Tally'), prevents overwriting an existing target file, and displays a progress bar during the operation. This is useful for archiving project files or backups. ```TallyScript ZIP: "D:\Target.zip": "D:Work*.txt": "Tally": No: Yes: Yes ``` -------------------------------- ### $$IsConfigObject Function Example Source: https://help.tallysolutions.com/developer-reference/tdl-enhancements-tally-prime/table-framework-tdl An example demonstrating the use of the $$IsConfigObject function in a Tally table definition. It shows how to apply specific styling to a table if it is a configuration object. ```tallyd [Table: Connectivity Settings Configure List] Use : Config Table Template Fetch : ShowAdvance Style : Normal Bold : $$IsConfigObject ``` -------------------------------- ### $$IsLabelObject Function Example Source: https://help.tallysolutions.com/developer-reference/tdl-enhancements-tally-prime/table-framework-tdl An example of using the $$IsLabelObject function in a Tally collection definition. It shows how to apply different colors to elements based on whether they are label objects. ```tallyd [Collection: MoreDetails Template] Set as : $Name Color : “Deep Grey” : NOT $FeatEnabled Color : “Black” : $$IsLabelObject ``` -------------------------------- ### Collection with Primary Objects (LedgerList) Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/objects-and-collections Demonstrates creating a collection named 'LedgerList' that directly gathers 'Ledger' type objects. This is a straightforward way to list primary entities. ```TDL [Collection: LedgerList] Type : Ledger ``` -------------------------------- ### Ignore Field Example Source: https://help.tallysolutions.com/developer-reference/tdl-enhancements-tally-prime/table-framework-tdl An example demonstrating the 'Ignore Field' action within a Tally object definition. This shows how to apply the action to a specific object and its associated actions. ```tallyd [Object: CoATemplate] Action : CoA : Display : List of Accounts Action : CoA : Ignore Field : Yes ``` -------------------------------- ### Between Operator Example Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/what-are-data-types-operators-and-expressions-in-tdl The Between operator returns TRUE if an operand's value falls within a specified lower and upper limit (inclusive). The 'Not' operator can be used to negate the condition. This example checks if '#Myfield' is between 50 and 150. ```TDL If #Myfield Between 50 And 150 Then 200 Else 500 ``` -------------------------------- ### In Operator Example Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/what-are-data-types-operators-and-expressions-in-tdl The In operator checks if a value exists within a comma-separated list. It returns TRUE if the operand is found in the list, otherwise FALSE. This example sets a value based on whether '#Myfield' is in the list (100, 200, 300). ```TDL Set As: If #Myfield IN (100,200,300) then 200 else 500 ``` -------------------------------- ### ActionEx Syntax and Basic Usage Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl Demonstrates the basic syntax of the ActionEx attribute for defining multiple actions associated with a button or key. It shows how to specify a label, action keyword, and optional parameters. ```tallydefinitionlanguage [Button: Show Final Accounts] Key : Ctrl + F ActionEx : TB : Display : Trial Balance ActionEx : PL : Display : Profit and Loss ActionEx : BS : Display : Balance Sheet ``` ```tallydefinitionlanguage [Button: Show Final Accounts] Key : Ctrl + F TB : Display : Trial Balance PL : Display : Profit and Loss BS : Display : Balance Sheet ``` -------------------------------- ### $$GetOnTheFlyString Function Example Source: https://help.tallysolutions.com/developer-reference/tdl-enhancements-tally-prime/table-framework-tdl An example illustrating the use of the $$GetOnTheFlyString function in a Tally object definition. It shows how to capture user-typed input for an 'On The Fly' object and use it to set a path. ```tallyd [Object: Provide File Path] Use : On The Fly Object Name : $$SysName:ProvidePath IsActive : Yes Action : Set Path : Set : On The Fly Path : $$GetOnTheFlyString ``` -------------------------------- ### Contains String Operator Example Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/what-are-data-types-operators-and-expressions-in-tdl The Contains operator (alias Containing) checks if the first string operand contains the second string operand. It returns 'Yes' if the substring is found, otherwise 'No'. This example checks if 'Hello TDL' contains 'TDL'. ```TDL Set As: “Hello TDL” Contains “TDL” ``` -------------------------------- ### System Action: Unzip (Full Unzip) Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl The 'Unzip' system action is used to extract all files and folders from a source zip file to a specified target folder. It supports password protection and an overwrite flag. This action is for complete unzipping only and cannot perform partial unzips. ```TallyScript Unzip : : [: [: [:]]] ``` -------------------------------- ### Ending With String Operator Example Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/what-are-data-types-operators-and-expressions-in-tdl The Ending With operator (alias Ending) checks if the second string operand ends with the first string operand. It returns 'Yes' if it ends with the specified string, otherwise 'No'. This example checks if 'World TDL' ends with 'TDL'. ```TDL Set As: If “World TDL” Ending with “TDL” Then “TDL” Else “World” ``` -------------------------------- ### Source Var Attribute Example (TallySolutions) Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/objects-and-collections Shows how to use the 'Source Var' attribute to evaluate and set the value of a variable based on a source object. It specifies the variable name, data type, and a formula for evaluation. ```TallySolutions Source Var : Log Var : Logical : No ``` -------------------------------- ### $$CurrentTable Function Example Source: https://help.tallysolutions.com/developer-reference/tdl-enhancements-tally-prime/table-framework-tdl Illustrates the usage of the $$CurrentTable function in a Tally object definition. This example shows how to conditionally set a system name based on a ##ShowHideInactive variable and how to modify the current table's properties. ```tallyd [Object: CoAShowinactiveMasters] Behave as: Action Name : If ##ShowHideInactive Then $$SysName:HideInactive Else $$SysName:ShowInactive Action : Config Action: Set : ShowHideInactive : NOT ##ShowHideInactive Action : Config Action: Change Table:$$CurrentTable:No:$$Type= “CoAShowinactiveMasters” ``` -------------------------------- ### Zip File with Password and Overwrite Control Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl This example demonstrates zipping a single file ('tally.ini') to a target ZIP file ('Target.zip') with a password ('Tally'). It specifies that the target file should not be overwritten if it already exists. This action is useful for creating secure backups or distributing specific files. ```TallyScript ZIP : ".Target.zip" : "tally.ini": "Tally" : No ``` -------------------------------- ### Create Ledger using 'Create' Action and 'Storage' Attribute Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl Demonstrates using the 'Create' action and the 'Storage' attribute at the Field Definition level to store values entered by the user within an associated Object. This example shows how to add a 'Ledger Creation' item to the 'Gateway of Tally' menu and configure the 'Create Ledger' report to store ledger name and group. ```tally [#Menu : Gateway of Tally] Add : Key Item : Ledger Creation : L : Create : Create Ledger [Report : Create Ledger] Form : Create Ledger Object : Ledger ;; Object Association done at Report Level [Form : Create Ledger] Parts : Create Ledger [Part : Create Ledger] Lines : Store LedgerName, Store LedgerGroup [Line : Store LedgerName] Fields : Short Prompt, Name Field Local : Field : Short Prompt : Info : "Name :" Local : Field : Name Field : Storage : Name /* Storing value entered by user in Internal Method Name available within Object associated at Report*/ [Line : Store LedgerGroup] Fields : Short Prompt, Name Field Local : Field : Short Prompt : Info : "Under :" Local : Field : Name Field : Storage : Parent Local : Field : Name Field : Table : Group /* Similarly, Parent Method is stored with the user entered value which is considered as the Group of the Ledger created. Also Group is a default Table/Collection to display all the default as well as the user defined Groups. Field Attribute Table helps to restrict the user input to a predefined list*/. ``` -------------------------------- ### Modify Object Example 2: Modifying Multiple Ledger Properties Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl This example illustrates modifying the 'OpeningBalance' of a specific bill, the ledger's overall 'OpeningBalance', and the first address line. It highlights the flexibility in specifying multiple modifications, including nested properties. ```tally [Key : Alter My Object] Key : Ctrl + Z Action : Modify Object :(Ledger,”MyLedger”).BillAllocations[1].OpeningBalance :1000,+ Name: ”My New Bill”,..Address[First].Address :”Hongasandra Bangalore”, Opening Balance:5000 ``` -------------------------------- ### Example: Full Unzip to Specific Target Folder Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl Illustrates the 'Unzip' system action to extract a zip file ('D:\Target.zip') into the 'Documents' folder within the current Tally application directory. The password 'Tally' is specified. ```TallyScript Unzip : "Documents" : "D:\Target.zip" : "Tally" ``` -------------------------------- ### $$CurrentTableObj Function Example Source: https://help.tallysolutions.com/developer-reference/tdl-enhancements-tally-prime/table-framework-tdl Provides an example of using the $$CurrentTableObj function in a Tally field definition. It demonstrates how to dynamically reference table object properties, specifically for showing or hiding elements based on system name comparisons. ```tallyd [Field: ImportFile] Use : File Selection Template Modifies : ImportFile : Yes : $$TableObj:ImportFile:$Path Case : Normal Width : @@LongWidth+10 Max : @@MaxNarrWidth Act on Table Element : (@ShowMore OR @ShowLess) : Execute Obj Actions : ShowMoreLess ShowMore : ($$IsSysNameEqual:ShowMore:($$CurrentTableObj:$Name)) ShowLess : ($$IsSysNameEqual:ShowLess:($$CurrentTableObj:$Name)) ``` -------------------------------- ### Define System Event Handlers in TDL Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl Explains how to register system-level events such as application start or company load using the [System : Events] definition. This allows developers to trigger specific actions when defined system conditions are met. ```TDL [System : Events] AppStart1 : System Start : TRUE : CALL : MyAppStart ``` -------------------------------- ### Triple and Triple List Attribute Examples Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/what-is-th-overall-perspective-on-tally-technology Shows examples of 'Triple' and 'Triple List' attributes. 'Triple' attributes accept three values and cannot be specified multiple times. 'Triple List' attributes also accept three values but can be specified multiple times. ```tally Object : Ledger Entries : First : $LedgerName = "Tally" ``` ```tally Aggr Compute : TrPurcQty: Sum : $BilledQty Aggr Compute: TrSaleQty : Sum : $BilledQty ``` -------------------------------- ### Tally Definition Language: GET Request with Headers Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/objects-and-collections Illustrates how to configure TallyPrime to send GET requests with custom HTTP headers to a server. This involves specifying the target URL using either 'Remote URL' or 'Data Source' attributes, along with the 'Export Header' attribute for header details. ```tdl [Collection: ] Export Header: Remote URL: ``` ```tdl [Collection: ] Export Header: Data Source: HTTP XML : [: ] ``` ```tdl [Collection: ] Export Header: Data Source: HTTP JSON : [: ] ``` -------------------------------- ### BrowseURLEx: Execute Application and Wait Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl Executes an external application (e.g., 7zip.exe) with specified command-line parameters and waits for its completion. This is crucial for scenarios where subsequent actions depend on the output or completion of the executed application. ```tallyscript Action : BrowseURL Ex: "C:\\7zip.exe": "D:\\software.7z" ``` -------------------------------- ### Modify Object Example 1: Altering Ledger Bill Allocations and Address Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl This example demonstrates modifying the 'OpeningBalance' of a specific bill within a ledger's 'BillAllocations' and updating the 'Address' of the ledger. It showcases the ability to modify different parts of an object hierarchy in one action. ```tally [Key : Alter My Object] Key : Ctrl + Z Action : Modify Object : (Ledger,”MyLedger”).BillAllocations [First, + $Name=”MyBill”].OpeningBalance : 100,Address[Last].Address :”Bangalore” ``` -------------------------------- ### Fetch Methods and Sub-collections using Wildcards in TDL Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/objects-and-collections Demonstrates how to use wildcard characters '?' and '*' in the Fetch attribute to retrieve methods and sub-collections from TDL objects. '?' fetches all methods of the current object, while '*' fetches all methods and sub-collections. ```TDL [Collection: Vouchers] Type : Voucher Fetch : Date, Narration ``` ```TDL [Collection: Vouchers] Type : Voucher Fetch : ? ``` ```TDL [Collection: Vouchers] Type :Voucher Fetch : * ``` ```TDL [Collection: Vouchers] Type : Voucher Fetch : Date, VoucherNumber, Narration, InventoryEntries.* ``` -------------------------------- ### Apply Unary Operators in TDL Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/what-are-data-types-operators-and-expressions-in-tdl Demonstrates the use of the percentage (%) operator for layout sizing and pattern matching, and the negation (-) operator for numeric values. ```TDL [Part: Title] Width : 20 %Screen [Field: Test Fld] Set As : If @@CMPMailName LIKE "%Ltd." Then "Limited Company" + Else "Public Company" [Field: Test Fld] Use : Number Field Set As : -100 ``` -------------------------------- ### $$IsOnTheFlyItemSelected Function Example Source: https://help.tallysolutions.com/developer-reference/tdl-enhancements-tally-prime/table-framework-tdl An example showcasing the $$IsOnTheFlyItemSelected function within a Tally field definition. It demonstrates its use in triggering actions based on whether an item selected from a table is an 'On The Fly' item, specifically for setting a new country value. ```tallyd [Field: EI BuyerGVAT POSCountry] Use : Name Field Set as : #SupplCountryName Set Always : Yes Storage : PlaceofSupplyCountry Table : ListOfCountries,NotApplicable,NewCountryName, CompanyCreatedCountry Trigger : NewCountryValName : $$IsSysNameEqual:NewCountry:$$EditData Act on Table Element : **$$IsOntheFlyItemSelected** : Set : NewCountry : $$GetOnTheFlyString ``` -------------------------------- ### Collection with Sub-Objects (Ledger Vouchers) Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/objects-and-collections Shows how to create a collection 'Ledger Vouchers' by gathering 'Vouchers' of a specific 'Ledger'. It uses a 'Child Of' clause to filter vouchers based on a user-selected 'LedgerName'. ```TDL [Collection: Ledger Vouchers] Type : Vouchers :Ledger Child Of : ##LedgerName ``` -------------------------------- ### Execute Dynamic Action from User Defined Function Source: https://help.tallysolutions.com/developer-reference/actions-events-buttons/what-are-actions-events-buttons-and-keys-in-tdl This example shows how to call a user-defined function that, in turn, executes a dynamic action. The function 'TestFunc' takes a string parameter and uses the 'Action' keyword to display content based on that parameter. ```tally [Button : Test Button] Key : F6 Action : Call : TestFunc : “Balance Sheet” [Function : Test Func] Parameter : Test Func : String 01 : Action : Display : ##TestFunc ``` -------------------------------- ### Example Report Variable Declarations Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/what-is-a-variable-in-tdl Provides a practical example of declaring different types of variables ('Emp Name', 'Emp Relation', 'Employee1', 'Employee2') within a report named 'SMP Report', including inline declarations with data types and values. ```tally [Report : SMP Report] Variable : Emp Name Variable : Emp Relation : String List Variable : Employee1 List Variable : Employee2 : String : “Prem” ``` -------------------------------- ### Aggregate UDF Syntax and Example Source: https://help.tallysolutions.com/developer-reference/tally-definition-language/what-are-user-defined-fields-validations-and-controls-in-tdl Demonstrates the syntax for repeating a line over an Aggregate UDF and provides an example of how fields within that line store values into component UDFs. The data entry continues until a specified break condition is met. ```Tally Definition Language [Part : Comp Vehicle] Line : Comp VehLn Repeat : Comp VehLn : Company Vehicles BreakOn : $$IsEmpty:$VBrand [Field : CMP VBrand] Use : Short Name Field Storage : VBrand ```