delete_master
Delete masters (ledger, group, stock item, etc.) from TallyPrime by name. Delete dependent vouchers first; if 'Cannot be deleted!' persists, run Company Data → Rewrite.
Instructions
Delete one or more masters (ledger, group, stock item, voucher type, unit, godown, cost centre, etc.) from TallyPrime by name. If a master was used in a voucher you're also deleting, delete the voucher first and confirm it succeeded before calling this — doing both in the same parallel batch can race (the master delete reaching Tally before the voucher delete has committed), confirmed live. If a ledger/stock item was used in both a Sales AND a Purchase item-invoice, it may return 'Cannot be deleted!' permanently even with no transactions left — this is fixed by running Company Data → Rewrite in Tally itself (confirmed live), not by retrying or sequencing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| names | Yes | Exact name(s) of the master(s) to delete | |
| collection | Yes | Type of master to delete, as Tally's XML tag name, e.g. 'LEDGER', 'GROUP', 'STOCKITEM', 'VOUCHERTYPE', 'UNIT', 'GODOWN', 'COSTCATEGORY', 'COSTCENTRE' |