Download Free Tools for Tally ERP
FREE utilities for Tally Accounting Software

Tuesday, February 20, 2007

Example 12a: Attributes ChildOf; BelongsTo; Filter

ChildOf attribute
The ChildOf attribute is used with Collections. It controls how the Collection is displayed. Example:-
[Collection: My Collection]
Type: Ledger
ChildOf: $$GroupSundryDebtors

The above TDL code returns all the Ledgers directly falling under Group "Sundry Debtors".

BelongsTo attribute
The BelongsTo attribute returns all the objects directly or indirectly falling under the specified Collection. Example:-
[Collection: My Collection]
Type: Ledger
ChildOf: $$GroupSundryDebtors
BelongsTo: Yes

The above TDL code returns all the Ledgers falling under Group "Sundry Debtors" and its sub-groups.

Filter attribute
The Filter attribute is used to set a filter on the Collection. Example:-
[Collection: My Collection]
Type: Ledger
ChildOf: $$GroupSundryDebtors
BelongsTo: Yes
Filter: MyFilter



[System: Formula]
MyFilter: $ClosingBalance > 0

The above TDL code returns all the Ledgers falling under Group "Sundry Debtors" and its sub-groups where the ClosingBalance is greater than Zero.

A TDL program illustrating the above attributes is given herewith for your reference. Click here to download the Example 12a compiled file and the source-code.
Tally; Tally Developer and Tally Definition Language are trademarks or registered trademarks of "Tally Solutions", Bangalore.