[#Collection: CmpLedgers] Fetch : LedgerName Where : IsInactive ?? (Overwrites the default collection to filter out any ledger where IsInactive = Yes.)
[#Field: My Custom Field] Type : String Width : 20 Let’s look at two real-world scenarios where TDL solves problems. Example 1: Add a “Delivery Note Number” Field to Sales Invoice The Problem: Your logistics team uses a separate delivery note series, but Tally’s standard invoice has no field for it. tdl for tally erp 9
TDL uses : (colon) for attributes and ## for commands. For example: TDL uses : (colon) for attributes and ## for commands
| Component | Description | Example Usage | | :--- | :--- | :--- | | | Defines a UI block (like a form or section). | Adding a new row to a sales invoice. | | #Field | Defines a single data entry element (text, date, number). | Adding a "Delivery Note No." field. | | #Collection | Fetches data from Tally’s database (like SQL SELECT). | Get all pending sales orders. | | #Report | Defines a custom report structure. | A new "Aging Analysis by Salesman" report. | | #Action | Defines what happens on a button click or key press. | Trigger a custom validation or export. | | #MenuLine | Adds or modifies menu items. | Add "My Tools" on the Gateway of Tally. | | | #Field | Defines a single data
In this article, we will explore what TDL is, why it is essential, its core architecture, real-world use cases, and how you can start writing your first TDL program. Tally Definition Language (TDL) is a metadata-driven, XML-like scripting language used exclusively within the Tally ecosystem. Think of it as a "skin and logic" modifier. TDL files (usually with .txt or .tdl extensions) are loaded into Tally ERP 9 at runtime.
Inactive ledgers vanish from all selection lists—no accidental selections. Example 3: Custom Print Format with Barcode The Problem: Your warehouse needs a barcode on every sales invoice.
[#Part: Vch Invoice Entry] Line : DeliveryNoteField [#Field: Delivery Note Field] Use : Name Field Name : VchDeliveryNote Caption : "Delivery Note No." Width : 15 Field Type : String Default Value : "DN/001"