Tally ERP 9 | Tally 9 | Tally 8.1 | Tally 7.2 | Tally 6.3 | Learn Tally TDL

Monday, February 26, 2007

Example 17: Using Ledger Object to display Ledger help-list

This program shows how you can display Ledger Name and Closing balances in HELP facility in a your TDL forms.

;; Modify the "Gateway of Tally" menu and Add a new option "Ledger Help"
[#Menu: GatewayOfTally]

;;Please note that the actions used here is CREATE and not DISPLAY as
;;User-input has to be enabled
Add: Item : Ledger Help : Create : rptLedger

;;Report definition
[Report: rptLedger]
Form: frmLedger

;;Form definition
[Form: frmLedger]
Part: prtMyPart1
Width: 70% screen
Height: 50% screen

;;Part definition
[Part: prtMyPart1]
Line: lnMyLine1

;;Line definition
[Line: lnMyLine1]
;;Short Prompt is a field defined in default TDL. Hence, it is just added to this line
;;but is not defined in this TDL.
Fields: Short Prompt, fldLedgerName

;;Modifies the field 'Short Prompt' locally
Local: Field: Short Prompt: Set As: "Ledger Name:"

;;Field definition
[Field: fldLedgerName]

;;Inherit from the default TDL field 'Name Field'
Use: Name Field

;;Field type
Type: String

;;This displays the Ledger help-list in a Table format
Table: My Ledgers

;;Display the Help-list Table always
ShowTable: Always

;;Variable to hold user-input
Variable: varLedgerName

;;Define a Collection named 'My Ledgers' which is used in the 'fldLedgerName' field
;;definition wherein the Table attribute displays the Collection data.
[Collection: My Ledgers]

;;Collection is based on Internal Object LEDGER which is defined in default TDL
Type: Ledger

;;Specify the format/width of Columns required in Help-List
Format: $Name, 30
Format: $ClosingBalance,15

;;This will display Phone Number
;;Format: $LedgerPhone

;;Local Variable definiton
[Variable: varLedgerName]
Type: String

Click here to download the Example 17 compiled file and the source-code.

Tally; Tally Developer and Tally Definition Language are trademarks or registered trademarks of "Tally Solutions FZ LLC", Bangalore.