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

Wednesday, August 15, 2007

Example 40: Accessing fields of an Object

This post illustrates how to access fields (i.e. Internal methods) of "Ledger" object. You can similary access other objects also.

Download TDL40
;; PRODUCT: TDL40.TXT
;; AUTHOR: Shweta Computers

;;Objective:-
;;Accessing fields (Internal Methods) of an Object
;;======================================================================

;;Add a new menu-item to the Gateway of Tally
[#Menu: Gateway of Tally]

;;The ACTION used here is DISPLAY
Item: Example 40: Display: My Report

[Report: My Report]
Form : My Form
Title: $$LocaleString:"Accessing Fields of an Object"

[Form: My Form]
Part: My Part

[Part: My Part]
Line: My Line1,My Line2

;;Shows border
Common Border: Yes

[Line: My Line1]
Left Fields: Short Prompt,Myfld1
Local: Field: Short Prompt : Set as : "Ledger Balance"

[Line: My Line2]
Left Fields: Short Prompt,Myfld2
Local: Field: Short Prompt : Set as : "Group Name"

[Field: Myfld1]
Use : Name Field
Set as : $ClosingBalance:Ledger:"Cash"

[Field: Myfld2]
Use : Name Field
Set as : $Parent:Ledger:"Cash"

NOTES:
1) Accessing fields of an Object
Syntax:-
<FieldName> : <Object> : <Filter Value>

Example:-
$Closingbalance : Ledger : "Cash"

Explanation:
a) $Closingbalance is a field of Object LEDGER. It is also called Internal Method
b) The 2nd parameter is the LEDGER Object
c) The 3rd parameter is the LEDGER Name ("Cash") whose field
value is to be retrieved.

2) Short Prompt is a pre-defined field. Herein, we are using LOCAL attribute
to modify the definition of the field Short Prompt which is effective only
in this Report.
Tally; Tally Developer and Tally Definition Language are trademarks or registered trademarks of "Tally Solutions", Bangalore.