create_unit
Creates a simple or compound Unit of Measure in TallyPrime for use in stock items and invoices. Prevents 'Unit does not exist!' errors when the unit is missing.
Instructions
Create a new Unit of Measure in TallyPrime — a simple unit (e.g. 'Kg', 'Box', 'Ltr') by default, or a compound unit (e.g. 'Box of 12 Nos') by passing baseUnit/additionalUnit/conversion. Required before creating or invoicing a stock item in a unit that doesn't exist yet — stock item/invoice tools fail with 'Unit does not exist!' otherwise. For a compound unit, both baseUnit and additionalUnit must already exist as simple units first (confirmed live pattern: create both simple units, then the compound unit referencing them). A simple unit's symbol (and baseUnit/additionalUnit, since those reference existing simple units' symbols) cannot contain whitespace — confirmed live: Tally rejects that with 'Master name contains invalid characters', checked client-side before this ever reaches Tally. A compound unit's own display name (e.g. 'Box of 12 Nos') can still contain spaces.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | The unit symbol as referenced elsewhere, e.g. 'Kg', 'Box', 'Box of 12 Nos' | |
| baseUnit | No | For a compound unit only: the larger/outer unit, e.g. 'Box'. Must already exist as a simple unit. | |
| conversion | No | For a compound unit only: how many additionalUnit make one baseUnit, e.g. 12. Required if baseUnit is set. | |
| formalName | No | Full name, e.g. 'Kilograms'. Optional. | |
| decimalPlaces | No | Decimal precision for quantities in this simple unit. Defaults to 0 (whole numbers only, e.g. 'Nos'). Ignored for a compound unit. | |
| additionalUnit | No | For a compound unit only: the smaller unit it's made of, e.g. 'Nos'. Must already exist as a simple unit. Required if baseUnit is set. |