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

Wednesday, August 29, 2007

Tally Software TDL functions

The following Tally Software TDL functions have been now included / covered :-

$$MonthOfDate
$$MonthStart
$$MonthEnd
$$SystemPeriodFrom
$$SystemPeriodTo
$$YearOfDate
$$YearEnd

Refer www.rtslink.com

Monday, August 27, 2007

Recycle bin for Tally Software with Source code

Recycle bin is a FREE add-on utility for Tally Software.

It enables you to retrieve Voucher entries that you may have accidentally deleted in Tally Software. It is similar to the Windows recycle-bin and works with Tally 7.2 and Tally 9.

Supports Tally 7.2 and Tally 9 Software.

View/Download the Recycle bin TCP Source-code.

Friday, August 24, 2007

Example 44: Adding FILTER button to MyDaybook

This program TDL44.TXT is an extension to my earlier program TDL43.TXT. It adds the FILTER button to My Daybook Report.

There are few minor modifications done to acheive the task:-
a) Add FILTER button to the FORM
b) Add few variables at the REPORT definition level

Download TDL44

The new code has been shown as highlighted.

;; PROGRAM: TDL44.TXT
;; AUTHOR : Shweta Computers
;;
;; Objective:- Adding Filter button to MyDaybook
;;======================================================================



;;Global Formula. Used to assign a simple text string to a Global constant.
[System: Formula]
MYDBKTDL: $LocaleString:"Daybook"



;;Add a new menu-item to the Gateway of Tally
[#Menu: Gateway of Tally]
Item: @@MYDBKTDL : Display: My DBKTDL



;;Control whether the menu-option is displayed or not?
Control: @@MYDBKTDL: $Allow:Display:Daybook



;; Syntax for $Allow
;; $Allow : <mode> : <family report name>
;; Return Value : Logical



[Report: MYDBKTDL]



Family: $Translate:"Daybook"
;; The attribute FAMILY specifies that this Report (i.e. MYDBKTDL)
;; belongs to a Family (report) named Daybook.
;; DAYBOOK is a pre-defined report and here we are specifying that
;; MYDBKTDL report belongs to the same DAYBOOK family.
;; This will affect ACCESS to MYDBKTDL report.
;; Now, when we change the ACCESS to DAYBOOK report using option
;; "Gateway of Tally -> Alt+F3 -> Security Features".
;; it will automatically affect the report MYDBKTDL



Title: $LocaleString:"Daybook"
Form : My Form



;;Variables used in the Report
Variables: SVFromDate,SVToDate,SVSortMethod
Variables: ExplodeFlag, ExplodeNarrFlag
Variables: OnlyAccVouchers,OnlyInvVouchers



Set: SV SortMethod : @@Default
Set: SVFromDate: $$MonthStart:##SVCurrentDate
Set: SVToDate: $$MonthEnd:##SVCurrentDate



;;Required for F12 Configuration
Repeat: SVColumntype, SVColumnName



;;PRINTSET affects the variables related to Printing, whereas
;;SET is used to assign values to variables used otherwise.
PrintSet: ReportTitle: $LocaleString:"Daybook"
PrintSet: PrintFileName: "Daybook"



[Form: My Form]



;;Pre-defined button. Adds the Print button
Button: PrintButton



;;EXPLODEFLAG is a pre-defined button in Default Tally.
;;Try using KEY instead of BUTTON, Alt+F1 still works,
;;but the "Alt+F1" button is not displayed
Button: ExplodeFlag



;;Pre-defined button. Required for F12 configuration
Button: DYBKConfigure



;;Pre-defined button. Filter records using Alt+F12 key
Button: FilterButton



Space Top : if $$InPrintMode then ##SVSpaceTop else 0.05 inches
Space Bottom: if $$InPrintMode then 0.5 else 0.05 inches
Space Left : if $$InPrintMode then 0.5 else 0.05 inches
Space Right : if $$InPrintMode then 0.25 else 0.05 inches



Part: My DB Title,My DB Body



[Part: My DB Title]



;;Optional Parts
Option: My DB PrntTitle : $$InPrintMode
Option: My DB ScrTitle : NOT $$InPrintMode



[!Part: My DB PrntTitle]



;;This is a pre-defined part in default TDL
Use: DSP AccTitles



[!Part: My DB ScrTitle]
Line: My DB Title



[Line: My DB Title]
Field : Name Field
Local : Field : Name Field : Set as : $$LocaleString:"Daybook"



[Part: My DB Body]
Line: My Line
Scroll: Vertical
Common Border: Yes
Repeat : My Line: My Collection



[Line: My Line]
Left Fields: Myfld1,MyFld2
Right Fields: MyFld3,MyFld4



;;This Shows the Ledger details when Alt+F1 key is pressed
Explode: MyExplodePart : ##ExplodeFlag



[Field: Myfld1]
;;TYPE attribute specifies the data-type of the field
Type : Date
Set as : $Date



[Field: Myfld2]
Use : Name Field
Set as : $$CollectionField:$LedgerName:1:AllLedgerEntries



[Field: Myfld3]
Use : Short Name Field
Set as : $VoucherTypeName



[Field: Myfld4]
Use : Amount Field
Set as : $Amount



;;Important:-
;;This PART is displayed when EXPLODEFLAG variable is set to Yes
;;i.e. When user presses Alt+F1 key
[Part: MyExplodePart]
Line : MyExplodline
Line : MyExplodeNarrLine



;;Repeats the line MyExplodeLine to display the AllLedgerEntries
;;Collection fields
Repeat : MyExplodline : AllLedgerEntries



;; Specify the fields that you wish to display when the PART is Exploded
[Line: MyExplodline]

;;Show this field on the left side of the line
Add: Left Fields: fldExplodeLedger,fldExplodeAmount



;;This skips the first object of Collection AllLedgerEntries
Empty: $$IsFirstObj



;;Ledger Name field
[Field: fldExplodeLedger]
Indent : 10
Use : Name Field
Set as : $LedgerName
Style : Small Italic
Width : @@NameWidth



;;Amount field
[Field: fldExplodeAmount]
Use : Amount Field
Set as : $Amount
Style : Small Italic
Width : @@ShortWidth



;; Line to Display Narration
[Line: MyExplodeNarrline]
Add: Left Fields: fldExplodeNarration



;;Display Narration field
[Field: fldExplodeNarration]
Indent : 12
Use : Name Field
Set as : $Narration
Style : Small Italic
Width : @@NameWidth



;;Collection definition
[Collection: My Collection]
Type: Voucher

Notes:-
1) This program is an extension of program TDL43.TXT
2) Herein, we have added Filter button to the MyDaybook Report.
To Filter records, press Alt+F12

Tuesday, August 21, 2007

TDL functions for Tally Software

The following TDL functions have been now included / covered :-

$$Upper
$$String
$$StringLength
$$StringPart
$$StringRemWord
$$StringWord

Refer www.rtslink.com

Monday, August 20, 2007

Example 43: Adding Narration line and F12 key functionality to My Daybook

This program TDL43.TXT is an extension to my earlier program TDL42.TXT. It adds the following functionality to the program TDL42.TXT (i.e. My Daybook Report)

a) Display the Narration line
b) Add F12 Configuration button

Please note that pressing F12 key displays the Configuration screen that contains several options. This programs addresses only the Narration option (and Condensed/Detailed) in the Configuration screen.

Download TDL43

The new code has been shown as highlighted.

;; PROGRAM: TDL43.TXT
;; AUTHOR : Shweta Computers
;;
;;Objective:-
;;To display Narration line and provide F12 Configuration key functionality
;;in My Daybook
;;======================================================================



;;Global Formula. Used to assign a simple text string to a Global constant.
[System: Formula]
MYDBKTDL: $LocaleString:"Daybook"



;;Add a new menu-item to the Gateway of Tally
[#Menu: Gateway of Tally]
Item: @@MYDBKTDL : Display: My DBKTDL



;;Control whether the menu-option is displayed or not?
Control: @@MYDBKTDL: $Allow:Display:Daybook



;; Syntax for $Allow
;; $Allow : :
;; Return Value : Logical



[Report: MYDBKTDL]



Family: $Translate:"Daybook"
;; The attribute FAMILY specifies that this Report (i.e. MYDBKTDL)
;; belongs to a Family (report) named Daybook.
;; DAYBOOK is a pre-defined report and here we are specifying that
;; MYDBKTDL report belongs to the same DAYBOOK family.
;; This will affect ACCESS to MYDBKTDL report.
;; Now, when we change the ACCESS to DAYBOOK report using option
;; "Gateway of Tally -> Alt+F3 -> Security Features".
;; it will automatically affect the report MYDBKTDL



Form : My Form



;;Title of the Report
Title: $LocaleString:"Daybook"



;;This variable is used in the current Report
Variables: ExplodeFlag, ExplodeNarrFlag



;;Required for F12 Configuration
Set : IsDaybook: Yes
Repeat: SVColumntype, SVColumnName



;;PRINTSET affects the variables related to Printing, whereas
;;SET is used to assign values to variables used otherwise.
PrintSet: ReportTitle: $LocaleString:"Daybook"
PrintSet: PrintFileName: "Daybook"



[Form: My Form]



Button: PrintButton
;;PrintButton is a pre-defined button. We just add is here.



Button: ExplodeFlag
;;EXPLODEFLAG is a pre-defined button in Default Tally.
;;Try using KEY instead of BUTTON, Alt+F1 still works,
;;but the "Alt+F1" button is not displayed



;;Required for F12 configuration
Button: DYBKConfigure



Space Top : if $InPrintMode then ##SVSpaceTop else 0.05 inches
Space Bottom: if $InPrintMode then 0.5 else 0.05 inches
Space Left : if $InPrintMode then 0.5 else 0.05 inches
Space Right : if $InPrintMode then 0.25 else 0.05 inches



Part: My DB Title,My DB Body



[Part: My DB Title]



;;Optional Parts
Option: My DB PrntTitle : $InPrintMode
Option: My DB ScrTitle : NOT $InPrintMode



[!Part: My DB PrntTitle]



Use: DSP AccTitles
;;This is a pre-defined part in default TDL



[!Part: My DB ScrTitle]
Line: My DB Title



[Line: My DB Title]
Field : Name Field
Local : Field : Name Field : Set as : $LocaleString:"Daybook"



[Part: My DB Body]
Line: My Line



Repeat : My Line: My Collection
;;Syntax:-
;;Repeat : :



Scroll: Vertical



;;Shows border
Common Border: Yes



[Line: My Line]
Left Fields: Myfld1,MyFld2
Right Fields: MyFld3,MyFld4



;;This Shows the Ledger details when Alt+F1 key is pressed
Explode: MyExplodePart : ##ExplodeFlag



[Field: Myfld1]
;;TYPE attribute specifies the data-type of the field
Type : Date
Set as : $Date



[Field: Myfld2]
Use : Name Field
Set as : $CollectionField:$LedgerName:1:AllLedgerEntries



[Field: Myfld3]
Use : Short Name Field
Set as : $VoucherTypeName



[Field: Myfld4]
Use : Amount Field
Set as : $Amount



;;Important:-
;;This PART is displayed when EXPLODEFLAG variable is set to Yes
;;i.e. When user presses Alt+F1 key
[Part: MyExplodePart]
Line : MyExplodline
Line : MyExplodeNarrLine



;;Repeats the line MyExplodeLine to display the AllLedgerEntries
;;Collection fields
Repeat : MyExplodline : AllLedgerEntries



;; Specify the fields that you wish to display when the PART is Exploded
[Line: MyExplodline]

;;Show this field on the left side of the line
Add: Left Fields: fldExplodeLedger,fldExplodeAmount



;;This skips the first object of Collection AllLedgerEntries
Empty: $IsFirstObj



;;Ledger Name field
[Field: fldExplodeLedger]
Indent : 10
Use : Name Field
Set as : $LedgerName
Style : Small Italic
Width : @@NameWidth



;;Amount field
[Field: fldExplodeAmount]
Use : Amount Field
Set as : $Amount
Style : Small Italic
Width : @@ShortWidth



;; Line to Display Narration
[Line: MyExplodeNarrline]
Add: Left Fields: fldExplodeNarration



;;Display Narration field
[Field: fldExplodeNarration]
Indent : 12
Use : Name Field
Set as : $Narration
Style : Small Italic
Width : @@NameWidth



;;Collection definition
[Collection: My Collection]
Type: Voucher

Notes:-
1) This program is an extension of program TDL42.TXT
2) We have added functionality to display the Narration line
3) We have added functionality for F12 Configuration key

TDL functions for Tally Software

The following TDL functions have been now included / covered :-

$$Alias
$$Allow
$$SerialNumber
$$SelectedCmps
$$SysName

Refer www.rtslink.com

Saturday, August 18, 2007

TDL Functions

The following TDL functions have been now included / covered :-

$$Abs
$$Max
$$Min
$$Round
$$RoundDown
$$RoundUp
$$ZeroFill

Refer www.rtslink.com

Thursday, August 16, 2007

TDL Functions

The following TDL functions have been now included / covered :-

$$LocaleString
$$InPrintMode
$$IsFirstObject
$$Value
$$IsEmpty

Refer www.rtslink.com

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.

Example 42: Adding Access-control functionality to menu-options

This post illustrates how to add Access-control functionality to menu-option MyDBKTDL (MyDaybook). This program (i.e TDL42) is an extension to our earlier program TDL41.

To understand this program, you must enable the Security features in your Company. It is advised to try out this program in a Dummy Company.

Steps enable Security Control:-
1) Open any Company (say Dummy)
2) Press Alt+F3 in the "Gateway of Tally" menu. This will bring forth "Company Info" screen.
3) Select option "Alter" and select the Company Name.
4) In the "Company Alteration" screen, set "Security Control" to YES and enter the ADMIN-name and password. Save the Company details.

Steps to Create new User:-
1) Press Alt+F3 in the "Gateway of Tally" menu and then select "Security Control" option.
2)Next, select option "Users and passwords" to create a user. Enter any Username (say ABC) and password and then set the "Security Level" to DATA ENTRY.

Steps to Assign rights to the new User:-
1) Press Alt+F3 in the "Gateway of Tally" menu and then select "Security Control" option.
2)Next, select option "Types of Security" and then disallow access to Report DAYBOOK to the User that you have created.

Summary
In the above mentioned steps, we have
a) Enabled "Security Control" in the Company Alteration screen
b) Created a new user.
c) Disallowed Access-rights to DAYBOOK report to the new User (ABC).

As you can see, we have restricted the newly created USER from Accessing the DAYBOOK Report. Now, in program TDL42, we create a new report MYDBKTDL which belongs to the DAYBOOK family. As a result, the ACCESS-CONTROL for DAYBOOK applies to MYDBKTDL also.

Download TDL42

;; PROGRAM: TDL42.TXT
;; AUTHOR : Shweta Computers

;;Objective:-
;;Allow/Disallow Access-control to Menu option that we have added in
;;Gateway of Tally
;;======================================================================

;;Global Formula. Used to assign a simple text string to a Global constant.
[System: Formula]
MYDBKTDL: $$LocaleString:"Daybook"

;;Add a new menu-item to the Gateway of Tally
[#Menu: Gateway of Tally]
Item: @@MYDBKTDL : Display: My DBKTDL

;;Control whether the menu-option is displayed or not?
Control: @@MYDBKTDL: $$Allow:Display:Daybook

;; Syntax for $$Allow
;; $$Allow : <mode> : <family report="" name="">
;; Return Value : Logical

[Report: MYDBKTDL]

Family: $$Translate:"Daybook"
;; The attribute FAMILY specifies that this Report (i.e. MYDBKTDL)
;; belongs to a Family (report) named Daybook.
;; DAYBOOK is a pre-defined report and here we are specifying that
;; MYDBKTDL report belongs to the same DAYBOOK family.
;; This will affect ACCESS to MYDBKTDL report.
;; Now, when we change the ACCESS to DAYBOOK report using option
;; "Gateway of Tally -> Alt+F3 -> Security Features".
;; it will automatically affect the report MYDBKTDL

Form : My Form

;;Title of the Report
Title: $$LocaleString:"Daybook"

;;This variable is used in the current Report
Variables: ExplodeFlag

;;PRINTSET affects the variables related to Printing, whereas
;;SET is used to assign values to variables used otherwise.
PrintSet: ReportTitle: $$LocaleString:"Daybook"
PrintSet: PrintFileName: "Daybook"

[Form: My Form]

Buttons: PrintButton
;;PrintButton is a pre-defined button. We just add is here.

Space Top : if $$InPrintMode then ##SVSpaceTop else 0.05 inches
Space Bottom: if $$InPrintMode then 0.5 else 0.05 inches
Space Left : if $$InPrintMode then 0.5 else 0.05 inches
Space Right : if $$InPrintMode then 0.25 else 0.05 inches

Part: My DB Title,My DB Body

Button: ExplodeFlag
;;EXPLODEFLAG is a pre-defined button in Default Tally.
;;Try using KEY instead of BUTTON, Alt+F1 still works,
;;but the "Alt+F1" button is not displayed

[Part: My DB Title]

;;Optional Parts
Option: My DB PrntTitle : $$InPrintMode
Option: My DB ScrTitle : NOT $$InPrintMode

[!Part: My DB PrntTitle]

Use: DSP AccTitles
;;This is a pre-defined part in default TDL

[!Part: My DB ScrTitle]
Line: My DB Title

[Line: My DB Title]
Field : Name Field
Local : Field : Name Field : Set as : $$LocaleString:"Daybook"

[Part: My DB Body]
Line: My Line

Repeat : My Line: My Collection
;;Syntax:-
;;Repeat : <line> : <Collection>

Scroll: Vertical

;;Shows border
Common Border: Yes

[Line: My Line]
Left Fields: Myfld1,MyFld2
Right Fields: MyFld3,MyFld4

;;This Shows the Ledger details when Alt+F1 key is pressed
Explode: MyExplodePart : ##ExplodeFlag

[Field: Myfld1]
;;TYPE attribute specifies the data-type of the field
Type : Date
Set as : $Date

[Field: Myfld2]
Use : Name Field
Set as : $$CollectionField:$LedgerName:1:AllLedgerEntries

[Field: Myfld3]
Use : Short Name Field
Set as : $VoucherTypeName

[Field: Myfld4]
Use : Amount Field
Set as : $Amount

;;Important:-
;;This PART is displayed when EXPLODEFLAG variable is set to Yes
;;i.e. When user presses Alt+F1 key
[Part: MyExplodePart]
Line : MyExplodline

;;Repeats the line MyExplodeLine to display the AllLedgerEntries
;;Collection fields
Repeat : MyExplodline : AllLedgerEntries

;; Specify the fields that you wish to display when the PART is Exploded
[Line: MyExplodline]

;;Show this field on the left side of the line
Add: Left Fields: fldExplodeLedger,fldExplodeAmount

;;This skips the first object of Collection AllLedgerEntries
Empty: $$IsFirstObj

;;Ledger Name field
[Field: fldExplodeLedger]
Indent : 10
Use : Name Field
Set as : IF NOT $$IsFirstObj then $LedgerName else ""
Style : Small Italic
Width : @@NameWidth

;;Amount field
[Field: fldExplodeAmount]
Use : Amount Field
Set as : $Amount
Style : Small Italic
Width : @@ShortWidth

;;Collection definition
[Collection: My Collection]
Type: Voucher

Notes:-
1) This program is an extension of program TDL41.TXT
2) ACCESS-CONTROL functionality is added to the menu-option MYDBKTDL using the $$Allow function.

Tuesday, August 14, 2007

Example 41: Adding Print functionality to MyDaybook

This post illustrates how to add Print functionality to the report MyDaybook. This program (i.e TDL41) is an extension to our earlier program TDL38.

Download TDL41

;; PRODUCT: TDL41.TXT
;; AUTHOR: Shweta Computers

;;Objective:-
;;Adding Print functionality to MyDaybook
;;======================================================================

;;Global Formula. Assign a text string to MYTDL41
[System: Formula]
MYTDL41: $$LocaleString:"Daybook"

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

;;ACTION used here is DISPLAY
Item: @@MYTDL41 : Display: My Report

[Report: My Report]

Form : My Form
Title: $$LocaleString:"Daybook"
Variables: ExplodeFlag

;;This is used to set the variables which will affect Printing only.
PrintSet: ReportTitle: $$LocaleString:"Daybook"
PrintSet: PrintFileName: "Daybook"

[Form: My Form]

;;PrintButton is a pre-defined button. We are just adding it here.
;;This will display a PRINT button on the right-hand side of Tally screen.
Buttons: PrintButton

Space Top : if $$InPrintMode then ##SVSpaceTop else 0.05 inches
Space Bottom: if $$InPrintMode then 0.5 else 0.05 inches
Space Left : if $$InPrintMode then 0.5 else 0.05 inches
Space Right : if $$InPrintMode then 0.25 else 0.05 inches

Part: My DB Title,My DB Body

;;Pre-defined button in Default Tally. Try using KEY instead of BUTTON,
;;Alt+F1 still works, but the "Alt+F1" button is not displayed
Button: ExplodeFlag

[Part: My DB Title]
Option: My DB PrntTitle : $$InPrintMode
Option: My DB ScrTitle : NOT $$InPrintMode

[!Part: My DB PrntTitle]
Use: DSP AccTitles

[!Part: My DB ScrTitle]
Line: My DB Title

[Line: My DB Title]
Field : Name Field
Local : Field : Name Field : Set as : $$LocaleString:"Daybook"

[Part: My DB Body]
Line: My Line

Repeat : My Line: My Collection
;;Syntax:-
;;Repeat : :

Scroll: Vertical

;;Shows border
Common Border: Yes

[Line: My Line]
Left Fields: Myfld1,MyFld2
Right Fields: MyFld3,MyFld4

;;This Shows the Ledger details when Alt+F1 key is pressed
Explode: MyExplodePart : ##ExplodeFlag

[Field: Myfld1]
;;TYPE attribute specifies the data-type of the field
Type : Date
Set as : $Date

[Field: Myfld2]
Use : Name Field
Set as : $$CollectionField:$LedgerName:1:AllLedgerEntries

[Field: Myfld3]
Use : Short Name Field
Set as : $VoucherTypeName

[Field: Myfld4]
Use : Amount Field
Set as : $Amount

;;Important:-
;;This PART is displayed when EXPLODEFLAG variable is set to Yes
;;i.e. When user presses Alt+F1 key
[Part: MyExplodePart]
Line : MyExplodline

;;Repeats the line MyExplodeLine to display the AllLedgerEntries
;;Collection fields
Repeat : MyExplodline : AllLedgerEntries

;; Specify the fields that you wish to display when the PART is Exploded
[Line: MyExplodline]

;;Show this field on the left side of the line
Add: Left Fields: fldExplodeLedger,fldExplodeAmount

;;This skips the first object of Collection AllLedgerEntries
Empty: $$IsFirstObj

;;Ledger Name field
[Field: fldExplodeLedger]
Indent : 10
Use : Name Field
Set as : IF NOT $$IsFirstObj then $LedgerName else ""
Style : Small Italic
Width : @@NameWidth

;;Amount field
[Field: fldExplodeAmount]
Use : Amount Field
Set as : $Amount
Style : Small Italic
Width : @@ShortWidth

;;Collection definition
[Collection: My Collection]
Type: Voucher

Notes:
1) This program is a extension to program TDL38.TXT

2) This program adds a button called PrintButton which is a
pre-defined button. This will add the Printing functionality
in our Report.

3) We have defined OPTIONAL parts "My DB PrntTitle" and "My DB ScrTitle"
as we want to have different titles for Printing and Screen.

4) We have added SPACE(s) to our Form for formatting purpose.
Example:-
Space Bottom: if $$InPrintMode then 0.5 else 0.05 inches

5) $$InPrintMode is a Internal function that returns logical true
if the report is being printed.

Example 39: Accessing fields of Company Object

This post illustrates how to access fields (i.e. Internal methods) of "Company" object.

Download TDL39


;; PRODUCT: TDL39.TXT
;; PRODUCT-ID: de535cfa-1r7f-3h7a-31h3-a5r55a984e6e
;; AUTHOR: Shweta Computers

;;Objective:-
;;Accessing fields of Company Object
;;======================================================================

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

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

[Report: My Report]
Form : My Form

[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 : "Company Number"

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

[Field: Myfld1]
Use : Short Name Field
Set as : $CompanyNumber:Company:##SVCurrentCompany

[Field: Myfld2]
Use : Short Name Field
Set as : $OwnerName:Company:##SVCurrentCompany

NOTES:

1) Accessing fields of Company Object
Syntax:-
: Company :

Example:-
$BooksFrom : Company : ##SVCurrentCompany

Explanation:
a) $BooksFrom is a field of Object Company. It is also called Internal Method
b) The 2nd parameter is the Company Object
c) The 3rd parameter is the Company Name (##SVCurrentCompany) 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.

Monday, August 13, 2007

Example 38: Using EXPLODE attribute to display Daybook in detailed format

This post illustrates how to use "EXPLODE" attribute at LINE-definition level.

TDL38 is an extension of program TDL30 in which we created a simple Daybook-style report. TDL38 adds new functionality to display the Daybook-report in Detailed format

Download TDL38

;;Objective:-
;;Using the EXPLODE attribute to display Ledgers details in
;;MY DAYBOOK format
;;======================================================================

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

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

[Report: My Report]
Form : My Form

[Form: My Form]
Part: My Part

;;Pre-defined button in Default Tally. Try using KEY instead of BUTTON,
;;Alt+F1 still works, but the "Alt+F1" button is not displayed
Button: ExplodeFlag

[Part: My Part]
Line: My Line

Repeat : My Line: My Collection
;;Syntax:-
;;Repeat : <line> : <collection>

Scroll: Vertical

;;Shows border
Common Border: Yes

[Line: My Line]
Left Fields: Myfld1,MyFld2,MyFld3,MyFld4

;;This Shows the Ledger details when Alt+F1 key is pressed
Explode: MyExplodePart : (##ExplodeFlag or $$KeyExplode)

[Field: Myfld1]
;;TYPE attribute specifies the data-type of the field
Type : Date
Set as : $Date

[Field: Myfld2]
;;The USE keyword inherits the functionality/properties of the specified object
Use : Short Name Field
Set as : $VoucherTypeName

[Field: Myfld3]
Use : Name Field
Set as : $$CollectionField:$LedgerName:1:AllLedgerEntries

[Field: Myfld4]
Use : Amount Field
Set as : $Amount

;;Important:-
;;This PART is displayed when EXPLODEFLAG variable is set to Yes
;;i.e. When user presses Alt+F1 key
[Part: MyExplodePart]
Line : MyExplodline

;;Repeats the line MyExplodeLine to display the AllLedgerEntries
;;Collection fields
Repeat : MyExplodline : AllLedgerEntries

;; Specify the fields that you wish to display when the PART is Exploded
[Line: MyExplodline]

;;Show this field on the left side of the line
Add: Right Fields: fldExplodeLedger,fldExplodeAmount

;;This skips the first object of Collection AllLedgerEntries
Empty: $$IsFirstObj

;;Ledger Name field
[Field: fldExplodeLedger]
Use : Name Field
Set as : IF NOT $$IsFirstObj then $LedgerName else ""
Style : Small Italic
Width : @@NameWidth

;;Amount field
[Field: fldExplodeAmount]
Use : Amount Field
Set as : $Amount
Style : Small Italic
Width : @@ShortWidth

;;Collection definition
[Collection: My Collection]
Type: Voucher

Notes:-
1) EXPLODE attribute is used at LINE definition level to display (i.e explode)
additional details.

2) When the user presses Alt+F1 key, the ledger details are shown.

3) The attribute EMPTY is used at LINE definition level as shown below:-

Empty: $$IsFirstObj

Syntax:- Empty : <condition>
The EMPTY attribute is used at the LINE definition level to skip the line,
if the condition is true. Herein, we have specified that 1st Object of the
Collection "AllLedgerEntries" must be skipped.

4) $$IsFirstObj
Return value: Logical
Checks whether the object is the 1st object or not in the given collection

5) CollectionField is a Tally Internal Function. It returns the Method/Field
data of the specified Collection as applied on the "nth" object of the
Collection. In the above code, it fetches the 1st LedgerName from the
Collection "AllLedgerEntries".

Syntax: $$CollectionField: <method field=""> : <positionnumber> : <collection>
Return Value: Method/Field value as specified as the 1st argument

6) AllLedgerEntries is a pre-defined Collection that contains Ledger details
for the VOUCHER object. $LedgerName is a method/Field of this collection.

7) Date,VoucherTypeName,VoucherNumber,Amount are methods/fields of
VOUCHER object.

8) NameWidth, ShortWidth, Small Italic are pre-defined Global formulaes.

Saturday, August 11, 2007

Example 37: Using "Control" attribute at Menu definition level

This post illustrates how to use "Control" attribute at menu-definition level.

Download TDL37


;;Objective:-
;;Using "Control" attribute at Menu level
;;=========================================================================

;;Global formula definition
[System: Formula]
locSR : $$LocaleString:"Sales Register"
locPR : $$LocaleString:"Purchase Register"

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

[Menu: My Menu]

;;1st Menu option
Item: @@locSR : Display : Sales Register

;;2nd Menu option.
Item: @@locPR : Display : Purchase Register

Item: Blank
Key Item: @@locQuit

Control : @@locSR : ##ShowSR
Control : @@locPR : ##ShowPR

[System: Variable]
ShowSR : Yes

;;This will hide the 2nd menu-option
ShowPR : No

[Variable: ShowSR]
Type : Logical

[Variable: ShowPR]
Type : Logical

Notes:-
1) We are using ITEM to define menu-items rather than using KEY ITEM
This is because KEY ITEM is supported in only Tally 9, whereas
ITEM is supported in both Tally 7.2 and Tally 9

Friday, August 10, 2007

Example 36: Disabling menu-options in Tally 7.2

This post illustrates how to disable a menu-option in Tally 7.2.

Download TDL36


;;Objective:-
;;Disabling Menu options in Tally 7.2
;;=========================================================================

;;Global formula definition
[System: Formula]
locSR : $$LocaleString:"Sales Register"
locPR : $$LocaleString:"Purchase Register"

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

[Menu: My Menu]
;;1st Menu option
Item: @@locSR : Display : Sales Register : ##ShowSR

;;2nd Menu option
;;This option is disable as variable ShowPR is set to NO
Item: @@locPR : Display : Purchase Register : ##ShowPR

Item: Blank
Key Item: @@locQuit

[System: Variable]
ShowSR : Yes
ShowPR : No

[Variable: ShowSR]
Type : Logical

[Variable: ShowPR]
Type : Logical

Example 35: Disabling menu-options in Tally 9

This post illustrates how to disable a menu-option in Tally 9.

Download TDL35


;;Objective:-
;;Disabling Menu Options in Tally 9
;;=========================================================================

;;Global Formula
[System: Formula]
locSR : $$LocaleString:"Sales Register"
locPR : $$LocaleString:"Purchase Register"

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

[Menu: My Menu]
;;KEY ITEM works with Tally 9 only.
;;Refer TDL36.TXT for Tally 7.2
Key Item: @@locSR : S : Display : Sales Register : ##ShowSR
Key Item: @@locPR : P : Display : Purchase Register : ##ShowPR
Item: Blank
Key Item: @@locQuit : Q

[System: Variable]
ShowSR : Yes
ShowPR : No

[Variable: ShowSR]
Type : Logical

[Variable: ShowPR]
Type : Logical

Thursday, August 9, 2007

Example 34: Using Validate Attribute at FIELD definition level

This post illustrates how to use "Validate" Attribute at FIELD definition level.

Download TDL34


;;Objective:-
;;Using "Validate" attribute at FIELD definition level
;;=========================================================================

;; Add a new menu-item to the Gateway of Tally. Note that the Action is
;; ALTER (and not display)

[#Menu:Gateway of Tally]
Item : Example 34 : Alter : My Report

[Report: My Report]
Form: My Form

[Form: My Form]
Part: My Part

[Part: My Part]
Line: My Line

[Line: My Line]
Fields: My Field1

[Field: MyField1]
Use: Name Field

;;Validates that the Field Value must not be Empty.
;;Similar to the "Control" attribute but does not display any message
Validate : NOT $$IsEmpty:$$Value
Notes:-
1)
$IsEmpty checks whether the parameter passed is Empty or not.
Syntax: $$IsEmpty:
2) $$Value
Returns the value of the current field



Example 33: Using "Control" Attribute at FIELD definition level

This post illustrates how to use "Control" Attribute at FIELD definition level.

Download TDL33

;; PRODUCT: TDL33.TXT
;;=========================================================================
;; Add a new menu-item to the Gateway of Tally. Note that the Action is
;; ALTER (and not display as used generally)



[#Menu:Gateway of Tally]
Item : Example 33 : Alter : My Report



[Report: My Report]
Form: My Form



[Form: My Form]
Part: My Part



[Part: My Part]
Line: My Line



[Line: My Line]
Fields: My Field1



[Field: MyField1]
Use: Name Field



;;Display a message if the Field Value is Empty
Control : EmptyValueMsg : $$IsEmpty:$$Value



;;Global formula
[System: Formula]
EmptyValueMsg : $$LocaleString:"Cannot be empty.\nPlease enter some value."
Notes:-
1)
$$IsEmpty checks whether the parameter passed is Empty or not.
Syntax: $$IsEmpty:
2) $$Value
Returns the value of the current field
3) \n is used for line-feed

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