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

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", Bangalore.