Tally TDL Tutorial: Add a Send WhatsApp Button in 5 Min
The quickest way to send a Tally bill on WhatsApp is a tiny TDL hook. Add one form edit, one shortcut key, and one Windows COM call. Here is the real code and four bugs to skip.
Override [#Form: Sales Color] to add an Alt+J button and an On : Form Accept event. Call a registered Windows COM interface with Exec COM Interface so Tally stays light while your local app sends the PDF.
What a Tally TDL Hook Does
TDL (Tally Definition Language) is Tally's screen code layer on Tally Developer Docs. Tally loads text .tdl files at startup via tally.ini to place custom keys on bills.
A COM bridge is a light Windows helper (Microsoft COM) paired via regasm. Tally saves the bill PDF in two lines, then hands the file path to the local app.
Exec COM Interface is the single TDL command that passes data from Tally to Windows with zero screen lag.
Minimal Working TDL Code
For example, every voucher hook in TallyWhatsApp follows this exact pattern:
[#Form: Sales Color]
Add : Button : Send Sales WA Btn
On : Form Accept : Yes : CALL : TallyWASendSales
[Button: Send Sales WA Btn]
Key : Alt + J
Title : Send WhatsApp
Action : Call : TallyWASendSales
[Function: TallyWASendSales]
; ... export PDF, then hand off via COM ...
The # modifier tells Tally to alter the built-in Sales Color screen instead of replacing it. You can use the same pattern on Receipt Color for receipts and Ledger Vouchers for statements.
Then inside your function, one line hands five parameters to Windows without stalling Tally's UI:
Exec COM Interface:TallyWASend:##Contacts:##Path:##Msg:"sale":##VchGuid
This passes the phone list, GST PDF path, note, voucher type, and key over local IPC to WhatsApp via Linked Devices. Zero cloud servers touch your bills.
4 Real TDL Bugs We Hit & Fixed
When building early builds of TallyWhatsApp, we hit four tricky Tally parser traps. Check this list before saving your script:
| Pitfall | Why It Breaks | Working Fix |
|---|---|---|
Using Alt+Q |
Alt+Q is Tally's Quit key |
Bind Alt+J, Alt+L, or Alt+W instead |
;; comments in step bodies |
Triggers T0008 parser error in numbered steps | Keep comments outside [Function] lines |
Static $Guid key |
Blocks resending the exact same bill later | Append $$Now for fresh intentional sends |
| Overlay form names | Names like DSP Ledger Vouchers fail silently |
Hook canonical form names only |
Ready-Made TDL vs. Writing Your Own
For instance, if you only want one button on bills for one shop, a tiny TDL works fine. Want multi-PC LAN routing, e-Invoice QR checks, and safe delays? Our v1.0.41 installer sets everything up for you.
New to TDL? Start with our Tally TDL basics guide or see TDL vs Add-Ons vs Cloud.
Ship Without Debugging TDL Boilerplate
Install TallyWhatsApp on Windows and get pre-tested TDL hooks plus the COM bridge in one click.