text
stringlengths
0
5.42k
source
stringclasses
1 value
What's New in Release 1. 8 59 1 <Key Formula> can be any expression which evaluates to a unique string value. It is optional Deleting elements from Simple List Variable using LIST DELETE Deleting a single element from a Simple List V ariable LIST DELETE : SLV Emp : “E001” The element identified by key 'E001' will be deleted from the S imple List V ariable SL V Emp. Deleting all elements from a Simple List V ariable LIST DELETE : SLV Emp Since key formula is not specifi ed, all elements from simple li st variable SL V Emp will be deleted. Deleting elements from a Compound List Variable using LIST DELE TE Deleting an element from a Compound List V ariable LIST DELETE : CLV Emp : “E001” The element identified by key 'E001' will be deleted from the Compound List V ariable “CL V Emp”. Deleting all elements from a Compound List V ariable LIST DELETE : CLV Emp Since key formula isn't specifie d, all elements from compound l ist variable CL V Emp are deleted. Action-LIST DELETE EX This action is used to delete an element from the list based on index. INDEX formula is optional. If not specified, all the elements in the list are deleted. A nega tive index denotes reverse position. Syntax LIST DELETE EX : <List Variable Specification> [:<Index Formula>] Where, <List Variable Specification> is the Simple List or Compound List V ariable specification. <Index Formula> can be any expression which evaluates to an index number. It is optional. Action LIST REMOVE is an alias for the action LIST DELETE. Action LIST REMOVE EX is an alia s for the action LIST DELETE EX.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 592 Deleting Elements from Simple List Variable using LIST DELETE E X Deleting a single element from a Simple List V ariable LIST DELETE EX : SLVEmp :2 The element identified by index number ' 2' will be deleted from Simple List V ariable SL V Emp. Deleting all elements from a Simple List V ariable LIST DELETE EX : SLVEmp Since index formula is not specified, all elements from Simple List V ariable SL V Emp are deleted. Deleting elements from a Compound List Variable using LIST DELE TE EX Deleting an element from a Compound List V ariable LIST DELETE EX : CLVEmp : 10 The element identified by index '1 0' will be deleted from the Compound List V ariable CL V Emp. Deleting all elements from a Compound List V ariable LIST DELETE EX : CLVEMP Since index formula isn't specified, all elements of compound l ist variable CL V EMP are deleted. 3. Expanding Elements in the List Variable Action-LIST EXPAND The Action LIST EXP AND is used to create the specified number o f blank elements and insert them into the list. All these elements are created without a key. If key specification is required for each element, then either LIST FILL or a loop can be used to ad d elements individually. Syntax LIST EXPAND : <List Variable Specification> : <Count Formula> Where, <List Variable Specification> is the Simple List or Compound List variable specification. <Count Formula> can be any expression which evaluates to a number. Example:Expanding Simple List Variable using LIST EXP AND LIST EXPAND : SLVEMP : 10 Here, count formula is 10. Hence, 10 blank elements are added to Simple List V ariable 'SL VEMP'. Expanding Compound List Variable using LIST EXP AND LIST EXPAND : CLVEMP : 5 Here, count formula is 5. Thus, 5 blank elements are added to t he Compound List V ariable 'CL VEMP'. LIST EXPAND : CLVEMP[1]. Relatives : 10
TDL_Reference_Manual.pdf
What's New in Release 1. 8 59 3 Here, count formula is 1 0. Hence, 10 blank elements are added to Compound List V ariable 'Relatives'. 'Relatives' is a Compound List Member variable of the Compound List V ariable 'CL VEMP'. Value Specifications The value for the Simple/List V ariables (Simple & Compound) can be specified using Attributes at Report and Form Level, and using Actions in User Defined Functi ons. Value specification at Report Level The attributes SET and PRINTSET are used to specify the variabl e values at Report Level. Attribute-SET The Report attribute SET can be used to specify a variable name and its value, which will be set during the startup of the report. Syntax SET : <Variable Specification> : <Value Expression> Where, <Variable Specification> is the variable path specification. <Value Expression> can be any expression, which evaluates to a value for the varia ble of the specified data type. Example: ;; Setting value to a Simple Variable SET : Var : “ABC” ;; Setting value to a Simple List Variable element SET : List Var[1] : “XYZ” ;; Setting value to Compound List Variable element's member SET : CLVEMP[1]. Name : “Kumar” Attribute-PRINT SET The Report attribute Print Set is similar to the SET attribute but sets the value of the varia bles to the specified value when the report is started in Print mode. Syntax PRINT SET : <Variable Specification> : <Value Expression> Where, <Variable Specification> is the variable path specification. <Value Expression> can be any expression which evaluates to a value for the variab le of the specified data type. Example: ;; Setting value to a Simple Variable PRINTSET : Var : “ABC” ;; Setting value to a Simple List Variable element
TDL_Reference_Manual.pdf
What's New in Release 1. 8 594 PRINTSET : List Var[1] : “XYZ” ;; Setting value to Compound List Variable element's member PRINTSET : CLVEMP[1]. Name : “Kumar” Value specification at Form Level Attribute-SET The Form attribute SET is similar to the Report attribute SET, the difference being that while the report sets the value once in its lifetime, the form SET is exe cuted during every regeneration/ refresh of the report. Syntax SET : <Variable Specification> : <Value Expression> Where, <Variable Specification> is the variable path specification. <Value Expression> can be any expression, which evaluates to a value for the varia ble of the specified data type. Example: ;; Setting value to a Simple Variable SET : Var : “ABC” ;; Setting value to a Simple List Variable element SET : List Var[1] : “XYZ” ;; Setting value to Compound List Variable element's member SET : CLVEMP[1]. Name : “Kumar” Value specification at Function Level Actions SET, MUL TISET, EXCHANGE, INCREMENT and DECREMENT are used. Action-SET V alues of variables can be set / updated via the SET action. Th is action is available as a global action, and can be used within a function also. List variables and compound variables cannot have values; they can have only element/member variables inside them, respectively. If SET action is used on compound variables, the value will be set to the FIRST member variable. If the first member variable is again compound, the program would search for the first non-compound leaf member and set the value. For list variables, the value is treated as the count, and the list is expanded by the number of elements provided in the expression. Syntax SET : <Variable Specification> : <Value Expression> Where, <Variable Specification> is the variable path specification.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 59 5 <Value Expression> can be any expression which evaluates to a value for the variab le of the specified data type. Example: ;; Setting value to a Simple Variable SET : Var : “ABC” ;; Setting value to a Simple List Variable element SET : SLVEMP[1] : “XYZ” ;; Setting value to Compound List Variable element's member SET : CLVEMP[1]. Name: “Kumar” Action-MUL TISET The action MUL TI SET is used to set the values of compound memb er variables in one call. All member specifications are relative to the compound variable spe cification given. Syntax MULTI SET : <Compound Variable Specification> + : <Member Specification : Value> [, <Member Specification : Value>,... ] Where, <Compound Variable Specification> is the Compound V ariable specification. <Member Specification : Value> is the list of name-value pairs for setting member values. Example: 1 MULTISET : CLVEMP[1] : Name : “Vimal”,Age : 26, Salary :($$As Amount : 10000) All member variables of 1st element of Compound List V ariable CL VEMP are set with MUL TISET. Example: 2 MULTISET : CLVEMP[1]. Relatives[1] : Name : “Hari”, Age : 20, + Relation:“Brother” Here, all member variables for the first element of the Compoun d List V ariable Relatives are set. Relatives is a Compound List Member variable of the Compound List V ariabl e CL VEMP. Action-EXCHANGE This action is used to swap the values of two variables, provid ed both belong to the same data type. This cannot be done for Simple List or Compound List as a whole. However, values of elements of Simple List and Compound List member variables havi ng same data type can be exchanged. Syntax EXCHANGE : <First Variable Specification> : <Second Variable + Specification>
TDL_Reference_Manual.pdf
What's New in Release 1. 8 596 Where, <First Variable Specification> is the simple variable specification. <Second Variable Specification> is the simple variable specification. Exchanging value of a Simple Variable with another Simple Varia ble EXCHANGE : Emp Var Old : Emp Var New Both the variables are of 'String' data type. The value of the variable Emp Var Old is exchanged with that of the variable Emp Var New on execution of the action. Exchanging value of an element of Simple List Variable with tha t of another Simple List Variable EXCHANGE : Slv Emp Old[1] : Slv Emp New[1] The value of the first element of Slv Emp Old is exchanged with that of the first element of Slv Emp New. Both the Simple List V ariables are of 'String' data type Exchanging value of a Simple variable with a member variable of a Compound List variable EXCHANGE : EMP Salary : CLVEmp[1]. Salary The value of a variable Emp Salary is exchanged with that of the member variable 'Salary' of the Compound List V ariable CL VEmp. Both the simple variables are of 'String' data type. Action-INCREMENT INCREMENT is a special action provided in 'Function' scope to i ncrement values of the variable. This is supported only on simple variables of type Number. Syntax INCREMENT : <Simple Variable Specification> [:<Num Increment Expression>] Where, <Simple Variable Specification> is the simple vari able specification. <Num Increment Expression> is an expression which evaluates to a number. Based on this, the variable value is incremented. It is optional. If not specified, variable value is incremented by 1. Example: INCREMENT : Counter ;; Incrementing the va riable value by 1 INCR : Counter : 2 ;; Incrementing the va riable value by 2 Action-DECREMENT Decrement is a special action provided in 'Function' scope to decrement v alues of the variable. It is supported only on simple variables of type Number. Action INCR is an alias for the action INCREMENT.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 59 7 Syntax DECREMENT : <Simple Variable Specification> [:< Num Increment Expression>] Where, <Simple Var Specification> is the simple variable specification. <Num Increment Expression> is an expression evaluating to a no., based on which, the variable value is decremented. It is opt ional. If not specified, the var iable value is decremented by 1. Example: ;; Decrementing the variable value by 1 DECREMENT : Counter ;; Decrementing the variable value by 2 DECR : Counter : 2 Value Modification at Field Level Attribute-MODIFIES The Field attribute 'Modifies' is used to modify the value of t he variable. Syntax Modifies : <Variable Specification> [:<Logical Flag>] Where, <Variable Specification> is the variable path specification. <Logical Flag> can be a logical value TRUE/FALSE. TRUE would set the value aft er the field's acceptance, while FALSE will set it during the acceptance of th e report having the field. Example: [Field : EMP Age] Modifies : EMPAge Var : Yes Here, value of the variable EMP Age V ar will be modified with the value stored/keyed in the field EMP Age after the field's acceptance. Retrieving value from List Function-$$List Value It is used to retrieve the value of an element in the list for a given key. If the list is of compound variables, an optional member specification can be given to ext ract value of a specific member. Action DECR is an alias for the action DECREMENT.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 598 Syntax $$List Value : <List Variable Specification> : <Key Formula> + [:<Member Specification>] Where, <List Variable Specification> is the Simple List or Compound List V ariable specification. <Key Formula> can be any expression which evaluates to a string value. <Member Specification> is required only if the value needs to be extracted from a spec ific member of a Compound List V ariable. Example: Retrieving value from Simple List Variable using $$List Value $$List Value : SLVEMP : "E001" In this example, the function returns the value of the element identified by the key 'E001' from the simple list variable 'SL V Emp'. $$List Value : SLVEMP : ##Key Var In this example, the variable 'Key V ar' holds the key value. The function returns the value of the element identified by the key from the simple list variable 'SL V Emp'. Retrieving value from Compound List Variable using $$List Value $$List Value : CLVEmp : ##Key Var : Age In this example, the variable 'Key V ar' holds the key value. The function returns the identified Compound List V ariable element's member variable value. In this case, the member specification has been specified as 'Age'. Function-$$List Value Ex The Function $$List V alue Ex returns the value of an element at t he specified index in the list. Syntax $$List Value Ex : <List Variable Specification>:<Index Formula> + [:< Member Specification>] Where, <List Variable Specification> is the Simple or Compound List V ariable specification. <Index Formula> can be any expression which evaluates to an index number. <Member Specification> is required only if the value needs to be extracted from a spec ific member of a Compound List V ariable. Example:Retrieving value from Simple List Variable using $$List Value Ex $$List Value Ex : SLVEmp : ##Index Var In this example, the variable 'Index V ar' holds the index value. The function returns the value of the element identified by the index from the simple list variab le 'SL V Emp'.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 59 9 Retrieving value from Compound List Variable using $$List Value E x $$List Value Ex : CLVEmp : ##Index Var : Age Here, variable 'Key V ar' holds the index value. The function ret urns the identified Compound List V ariable element's member variable value. Here, the member specified is 'Age'. Index Based Retrieval using ## Operator The operator ## is used to access the value of the variable. It also allows dotted notation syntax to access variables/member variables/element variables of a list a t any level. When ## is used on a compound variable (without path specificat ion), it returns the value of the first member variable, by default. Similarly, on a list variable, it returns the no. of items in the list. Syntax ##<Element Variable Specification>. <Member Variable Specification>. + <Simple Member Value specification> Where, <Element Variable Specification> can be a Compound V ariable or Compound List V ariable [Index Expression]. <Member Variable Specification> can be a Compound V ariable Member or Compound List Member V ariable [Index Expression]. <Simple Member Value Specification> refers to the name of a simple member in specified path. <Index Expression> is an expression that evaluates to a no. Suffixing a variable w ith index refers to an element variable. It can be positive or negative. Negative index denotes reverse access. Example:Retrieving Value from Simple List Variable using ## Operator SET : Temp Var : ##SLVEMP[3] V alue of element in SL VEMP, identified by the index '3', will be set to the variable 'T emp Va r '. Retrieving Value from Compound List Variable using ##Operator LOG : ##CLVEmp[2]. Relatives[1]. Name Here, we are retrieving value of the identified Compound List V ariable (Relatives) element's member variable value. 'Relatives' is a member variable of the Compound List V ariable CL VEMP. Looping Construct-For In/For Each The FOR IN loop is used to iterate over the values in the list variable. The number of iterations depends on the number of items in the list variable. Syntax FOR IN : <Iterator Variable> : <List Variable Name >.. END FOR
TDL_Reference_Manual.pdf
What's New in Release 1. 8 600 Where, <Iterator Variable> is the name of the variable which holds the Key value in every iteration. <List Variable Name> is the name of the Simple List or Compound List V ariable. This construct will walk only the elements in the list which ar e having a key. Since the iterator variable is filled with a key for each element, all elements which do not have a key are ignored. This is useful to walk keyed list variable elements in the curr ent sorting order. If the element does not have a key, then other loops like WHILE, FOR, etc., can be used and the el ements can be operated via index. Example: Iterating the Simple List Variable Values FOR IN : Key Var : SLV Emp LOG : $$List Value : SLVEmp : ##Key Var END FOR Here, the iterator variable “Key V ar” holds the Key value in eve ry occurrence of the iteration. In every iteration, the value of the element identified by the key is logged using the function $$List Value. Iterating the Compound List Variable Values FOR IN : Key Var : CLV Emp LOG : $$List Value : CLVEmp : ##Key Var : Age END FOR Here, the iterator variable “Key V ar” holds the Key value in eve ry iteration. In every iteration, the value of the member “Age” of the element of “CL VEMP” identified by the key is logged using the function $$List Value. List Variable Specific Functions Function-$$List Key The function $$List Key returns the corresponding key for the gi ven index. Syntax $$List Key : <List Variable Specification> : <Index Specification> Where, <List Variable Specification> is the Simple List or Compound List V ariable specification. <Index Specification> can be any expression which evaluates to a number. The looping construct FOR EACH is an a lias for the looping construct FOR IN.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 60 1 Example: Retrieving key from a Simple List Variable using $$List Key 01 : LOG : $$List Key : SLVEMP : 2 In this example, the function $$List Key retrieves the Key of th e second element of the Simple List V ariable 'SL VEMP'. Retrieving key from a Compound List Variable using $$List Key 02 : LOG : $$List Key : CLVEmp[1]. Relatives : 1 Here, key of first element of Compound List V ariable 'Relatives ' is retrieved. 'Relatives' is a member of Compound List V ariable 'CL VEMP'. Function-$$List Index The function $$List Index returns the Corresponding index for the given Key. Syntax $$List Index : <List Variable Specification> : <Key Specification> Where, <List Variable Specification> is the Simple List or Compound List V ariable specification. <Key Specification> can be any expression which evaluates to a string value. Example:Retrieving index from a Simple List Variable using $$List Index 01 : LOG : $$List Index : SLVEMP : E001 Here, index of the element identified by the key value 'E001' i s retrieved from 'SL VEMP'. Retrieving index from a Compound List Variable using $$List Inde x 02 : LOG : $$List Index : CLVEmp : E001 Here, index value of the element identified by the key value 'E 001' is retrieved from 'CL VEMP'. Function-$$List Count The function $$List Count retrieves the number of items in the l ist. Syntax $$List Count : <List Variable Specification> Where, <List Variable Specification> is the Simple List or Compound List V ariable specification. Example: 01 : LOG : $$List Count : SLVEMP 02 : LOG : $$List Count : CLVEMP Function-$$List Find It is used to check if a given key exists in the list or not. I t returns a logical flag as a result.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 602 Syntax $$List Find : <List Variable Specification> : <Key Formula> Where, <List Variable Specification> is the Simple List or Compound List V ariable specification. <Key Formula> can be any expression which evaluates to a string value. Example: 01 : LOG : $$List Find : SLVEMP : E001 02 : LOG : $$List Find : CLVEMP : E001 Function-$$List Value Find This function can be used to check if a given value exists in t he list. If a given list has more than one same value, the index can be used to retrieve the n'th matc hing value. Syntax $$List Value Find : <List Variable Specification> : < Occurance + Specification> : <Value Formula> [:<Member Specification>] Where, <List Variable Specification> is the Simple List or Compound List V ariable specification. <Occurance Specification> can be any expression which evaluates to a number. <Value Formula> can be any expression which evaluates to a value. <Member Specification> can be specified if the list element is compound. It is optiona l. Example: ;; Finding value from the Simple List Variable 01 : LOG : $$List Value Find : SLVEMP: 1 : RAMESH ;;Finding value from the Compound List Variable with member specification 03 : LOG : $$List Value Find : CLVEmp : 1 : PRIYA : Name The function will return YES if the value exists in the list, e lse it will return NO. Populating a List from a Collection Action-LIST FILL It is used to fill a list from a collection instead of using th e looping constructs. The specified collection is walked and the key formula and value formula is e valuated in the context of each object to create list elements. Syntax LIST FILL : <List Variable Specification> : <Collection Name> + [:<Key Formula> [:<Value Formula> [:<Member Specification>]]] Where, <List Variable Specification> is the Simple List or Compound List V ariable specification.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 60 3 <Collection Name> is the name of the collection from which the values need to be fetched to fill the list variable. <Key Formula> can be any expression which evaluates to string value. It is op tional. <Value Formula> can be any expression which returns a value. The data type of t he value must be same as that of the List variable. V alue formula is optional. If not specified, only KEY is set for each added element. <Member Specification> can be given if the list contains a compound variable Example: Populating a Simple List Variable from a Collection LIST FILL : SLV Emp : Employees : $Name : $Name All the employee names from the collection 'Employees' will be added to the Simple List V ariable, once the action LIST Fill is executed. Populating a Compound List Variable from a Collection LIST FILL : CLV Emp : Employees : $Name : $Name In this example, all the employee names from the collection 'Em ployees' will be added to the first member variable, as there is no member specification. LIST FILL : CLV Emp : Employees : $Name : $Designation: Designation In this example, Designations of all the employees from the col lection 'Employees' will be added to the member variable 'Designation'. LIST FILL : CLV EMP[1]. Relatives:Employees : $Name : $Spouse Name : Name Spouse name of all employees from the collection 'Employees' wi ll be added to member variable 'Name' of Compound List V ariable 'Relatives'. 'Relatives' is a member variable of 'CL VEMP'. Sorting of List Elements Initially, when the list variable is created, it is sorted on the order of insertion. TDL provides the facility to sort the values in the list variable based either o n key or on value. The following actions allow changing the sort order: List Key Sort List V alue Sort List Reset Sort Action-LIST KEY SORT The action LIST KEY SORT allows the user to sort the elements o f the list based on the key. If both key and value are not specified, blank elements are added to the list.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 604 Keys are by default of type 'String'; so, the absence of key da ta type specification will consider key data type as String while sorting. The user can override th is by specifying a key data type. Keys are optional for elements. All elements in the list may not have a key. In such cases, comparisons of elements would be done based on the insertion or der. Syntax LIST KEY SORT : <List Variable Specification> [:<Ascending/Descending Flag> [:<Key Datatype>]] Where, <List Variable Specification> is the Simple List or Compound List V ariable specification. <Ascending/Descending Flag> can be YES/NO. YES is used to sort the list in ascending order and NO for descending. If the flag is not specified, then the d efault order is ascending. <Key Data T ype> can be String, Number, etc. It is optional. Example: Sorting Simple List based on Key LIST KEY SORT : SLVEmp : Yes : String ;;Ascending Order LIST KEY SORT : SLVEmp : No : String ;;Descending Order Sorting Compound List based on Key LIST KEY SORT : CLVEmp : Yes : String ;;Ascending Order LIST KEY SORT : CLVEmp[1]. Relatives : No : String ;;Descending Order Action-LIST V ALUE SORT The action LIST V ALUE SORT allows the user to sort the elements of the list based on value. The data are sorted as per the data type specified for the list var iable in case of simple list, and the member specification data type in case of compound list. If a c ompound list is chosen and member specification is not specified, then the list is sorted by value of the first member variable. If duplicate values are in the list, the key data type passed is considered to sort by key, and then in absence of key, insertion order is used. Syntax LIST VALUE SORT : <List Variable Specification> [:<Ascending/Descending + Flag> [:<Key Datatype> [:<Member Specification>]]] Where, <List Variable Specification> is the Simple List or Compound List V ariable specification. The action LIST SORT is an a lias for the action LIST KEY SORT.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 60 5 <Ascending/Descending Flag> can be YES/NO. YES is used to sort the list in ascending order and NO for descending. If the flag is not specified, then the d efault order is ascending. <Key Data T ype> can be String, Number, etc. It is optional. <Member Specification> is the member specification in case of compound list. If not sp ecified, the list is sorted by the value of first member variable. Example:Sorting Simple List based on Value ;;Ascending Order LIST VALUE SORT : SLVEmp : Yes : String ;;Descending Order LIST VALUE SORT : SLVEmp : No : String Sorting Compound List based on Value ;;Ascending Order LIST VALUE SORT : CLVEmp : Yes : String ;;Descending Order LIST VALUE SORT : CLVEmp[1]. Relatives : No : String Action-LIST RESET SORT This action resets the sorting method of the list and brings it back to the insertion order. Syntax LIST RESET SORT : <List Variable Specification> Where, <List Variable Specification> is the Simple List or Compound List V ariable specification. Example: LIST RESET SORT : SLVEMP LIST RESET SORT : CLVEMP 4. 6 Some Common Functions Used Function-$$Is Sys Name Var This function checks if the variab le has a value which is a Sys Name like 'Not Applicable', 'End of List', etc. In case of repeated variables, if any one value is a non-sysname, it returns FALSE. Syntax $$Is Sys Name Var : <Variable Specification> Where, <Variable Specification> is the simple variable path specification. Example: $$Is Sys Name Var : Emp Var Here, $$Is Sys Name V ar returns YES if variable Emp Var has Sysname as value, else returns NO.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 606 Function-$$Is Default Var This function determines if the content of the variable has a “ Default” or blank as the value. This function is applicable only for Simple variables. In case of si mple repeated variable, if any one value is non-default, then this is not a default variable, and the function returns NO. Syntax $$Is Default Var : <Variable Specification> Where, <Variable Specification> is the simple variable path specification. Example: [Field : Default Var] Set as : $$Is Default Var : SVValuation Method $$Is Default V ar returns YES if value of SVValuation Method is blank or Default, else returns NO. Function-$$Is Actuals Var This function checks if the content of the variable is blank or sysname or “ACTUALS”. Syntax $$Is Actuals Var : <Variable Specification> Where, <Variable Specification> is the simple variable path specification. Example: $$Is Actuals Var : SVBudget YES is returned if the value of variable SVBudget is Blank or Sysname or “ACTUALS”, else NO. Function-$$Is Current Var This function checks if the content of the variable is Blank or Sysname or “Stock in hand”. Syntax $$Is Current Var : <Variable Specification> Where, <Variable Specification> is the simple variable path specification. Example: $$Is Current Var : DSPOrder Combo YES is returned if value of DSPOrder Combo is Blank or Sysname or Stock-In-Hand, else NO. Function-$$Exec Var This function returns the value of a variable in the parent rep ort chain. Syntax $$Exec Var : <Variable Specification>
TDL_Reference_Manual.pdf
What's New in Release 1. 8 60 7 Where, <Variable Specification> is the simple variable path specification. Example: $$Exec Var : DSPShow Monthly Function $$Exec V ar returns the va lue of the variable DSPShow Mon thly from the parent report. Function-$$Field Var This function returns the value of the field which is acting as a variable with the specified name. Syntax $$Field Var : <Variable Specification> Where, <Variable Specification> is the simple variable path specification. Example: [Collection : Godown Child Of Godown Name] Type : Godown Child of : $$Field Var : DSPGodown Name In this example, $$Field V ar is used to fetch the value of the v ariable DSPGodown Name whose value is modified in a field. This value becomes the value for the 'Child Of' attribute. Function-$$Parent Field Var This function gets the field variable value from its parent rep ort. Syntax $$Parent Field Var : <Variable Specification> Where, <Variable Specification> is the simple variable path specification. Example: [Field : Parent Field Var] Set as : $$Parent Field Var : SVStock Item Here, the function returns field variable value from its parent report for the variable “SVStock Item”. 4. 7 Field Acting as a Variable The 'V ariable' attribute in a 'Field' Definition is used to mak e the field behave as a variable, with the specified name. The variable need not be defined as it inherits data type from the field itself. Field can act as a simple variable only, since it can hold only simple value. Syntax [Field : <Field Name>] Variable : <Variable Name>
TDL_Reference_Manual.pdf
What's New in Release 1. 8 608 Where, <Field Name> is the name of the field. <Variable Name> is the name of the variable. Example: [Field : Employee Name] Variable : Emp Name Var 4. 8 Implication of Repeat Variables in Columnar Report The report in which a number of columns can be added or deleted as per the user inputs, is referred to as Columnar Report. In a Columnar Report, Lines are repeated vertically and Fields are repeated horizontally. The Columnar Report can be a: Multi Column Report-Column can be repeated based on the user inputs. Auto Column Report-Multiple columns can be repeated based on the user input, on t he single click of a button. Automatic Auto Columns-Report can be s tarted with predefined m ultiple columns without user intervention. The Attribute 'Repeat'-Variable, Report and Line Let us see the implications of R epeat Attribute of V ariable / R eport / Line Definitions in context of Columnar Reports. 1. 'Repeat' Attribute of Variable definition Please refer to the topic “V ariable Definition and Attributes”. 2. 'Repeat' Attribute of Report definition The Repeat Attribute of 'Report' definition is used specifically in Column ar Reports. When we specify 'Repeat' attribute with a variable name, the report bec omes a Columnar Report and the number of columns depends upon the values stored in the variabl e. Only simple variables can be repeated. Also, a report can have more than one variables repeated. In such ca ses, the number of columns in the report depends on the maximum value a Repeat V ariable holds. The 'Repeat' attribute of the report is declaration cum repeat specification; so a separate declaration is not required. Even if a declaration is done usin g 'V ariable' attribute, 'Repeat' is con-sidered as a repeat specification. Syntax [Report : <Report Name>] Repeat : <Variable Names> Where, <Report Name> is the name of the Report. <Variable Names> is the comma-separated list of variables. 3. Repeat Attribute of Line Definition The 'Repeat' Attribute of 'Line' Definition is used to repeat t he Field horizontally in columns. Syntax [Line : <Line Name>] Repeat : <Field Name>
TDL_Reference_Manual.pdf
What's New in Release 1. 8 60 9 Where, <Line Name> is the name of the line. <Field Name> is the name of the Field which needs to be repeated. Example: Let us look into the usage of 'Repeat' Attribute at V ariable/Re port/Line Definitions in designing the Columnar Stock Item-wise Customer-wise Sales Report. In this report, Stock Item names should be repeated vertically and Customer/Pa rty names horizontally. The columns should be automatically available when the report is started. Repeat Attribute of Variable Definition [Variable : PName] Type : String Repeat : ##DSPRepeat Collection The variable 'DSPRepeat Collection' holds the collection name 'C FBK Party'. This collection contains a method name 'PName'. In this case, the variable 'PName' would be filled with the method value from each object of the collection “CFBK Party”. [Collection : CFBK Party] Source Collection : CFBK Voucher Walk : Inventory Entries By : PName : $Party Ledger Name Aggr Compute : Billed Qty : SUM: $Billed Qty Filter : Non Empty Qty V ariable 'PName' holds multiple values based on implicit index. Method value of each object of collection 'CFBK Party' is picked up and stored in the variable's 1st index, 2nd index, and so on. 'Repeat' Attribute of Report Definition [Report : CFBK Rep] Use : DSP Template Form : CFBK Rep Variable : Do Set Auto Column, PName Repeat : PName Set : Do Set Auto Column : Yes Set : DSPRepeat Collection : “CFBK Party”Set : SVFrom Date : $$Month Start : ##SVCurrent Date Set : SVTo Date : $$Month End : ##SVCurrent Date
TDL_Reference_Manual.pdf
What's New in Release 1. 8 610 The attribute “Repeat” determines that it is a Columnar Report. The number of columns depends on the number of values available in the variable “PName”. Repeat Attribute of Line Definition [Line : CFBK Rep Details] Fields : CFBK Rep Name, CFBK Rep Party, CFBK Rep Col Total Repeat : CFBK Rep Party Total : CFBK Rep Party Field 'CFBK Rep Party' is repeated based on the no. of values of variable (Num Sets). S o, those many numbers of instances of the field are created. Each field will have an implicit index number (starting from 1). This implicit index is used to evaluate expr essions in the context of the field. Common Functions used with Columnar Reports Function-$$Num Sets It returns the number of columns in the report. It does not tak e any parameter. If the report is an auto report or sub report, it returns the number of columns in the parent of the auto/sub report. Number of set is the maximum number of values a repeated variab le can hold in that report. Syntax $$Num Sets Example: [Field : CFBK Rep Col Total] Use : Qty Primary Field Set as : $$Total : CFBKRep Party Border : Thin Left Invisible : $$Numsets=1 In this example, the 'T otal' column will be invisible if there is only one colu mn in the report. Function-$$Low Value This function can be used to get the lowest value in a set of v alues in the repeated variable. Syntax $$Low Value : <Variable Specification> Where, <Variable Specification> is a simple variable specification. Example:Let us suppose that the Repeat V ariables in a Columnar Report a re SVFrom Date and SVT o Date. Consider the following Field Definition in the same report:
TDL_Reference_Manual.pdf
What's New in Release 1. 8 61 1 [Field : Variable Low Value] Use : Name Field Set as : $$Low Value : SVFrom Date $$Lowvalue returns the lowest value in a set of values in the repeat varia ble SVFrom Date. Function-$$High Value This function can be used to get the highest value in a set of values in the repeated variable. Syntax $$High Value : <Variable Specification> Where, <Variable Specification> is a simple variable specification. Example:Suppose that the Repeat V ariables in a Columnar Report are SVFrom Date and SVT o Date. Consider the following Field definition in the same report: [Field : Variable High Value] Use : Name Field Set as : $$High Value : SVTo Date $$High Value returns the highest value in a set of values in the repeat vari able SVT o Date. Function-$$Is Common This function is used with repeat ed variable to check if all th e values in the repeat set are same. Syntax $$Is Common : <Variable Specification> Where, <Variable Specification> is a simple variable specification. Example:Suppose the Repeat V ariable in a columnar report is SVCurrent Co mpany. Consider the following Field Definition in the same report: [Field : Variable Is Common] Use : Logical Field Set as : $$Is Common : SVCurrent Company $$Is Common returns YES if all values in SVCurrent Company are same, otherwise returns NO. Function-$$Var Range Value This function gets a list of variable values, separated by the specified separator character. If no separator character is specified, comma (,) is taken as the separator character by default.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 612 Syntax $$Var Range Value : <Variable Specification> [:<Separator Character> [:<Start Position> [:<End Position>]]] Where, <Variable Specification> is the simple variable specification. <Separator Character> is the separator character. <Start Position> is the index which denotes the starting position. <End Position> is the index which denotes the ending position. If Start and End Positions are specified, the function will ret urn the values of repeat variable within the Specified index Range. Again, specifying End Position is op tional. If the End Position is not specified, the function will return the entire set of values fr om the starting position. Example: $$Var Range Value : SVFrom Date In this example, the function returns the entire set of values of the Repeat V a riable SVFrom Date. $$Var Range Value : SVFrom Date:",":1:5 Here, the function returns the value of specified index range ( 1 to 5) of the Repeat V ariable SVFrom Date $$Var Range Value : SVFrom Date:",":3 The entire set of values from Starting Index position of the re peat variable SVFrom Date are returned. 4. 9 Variables Usage and Behaviour in Auto Report A report can be marked as an auto report via AUTO attribute, which indicates the system that the report cannot instantiate its own variables. It will inherit va riables from parent scope. It is mainly used for configuration reports which require modifying configur ation variables of parent report. Syntax [Report : <Report Name>] Auto : <Logical Value> Where, <Report Name> is the name of the report. <Logical Value> can be YES / NO. The de fault value is NO. Example: [Report : Voucher Configuration] Specifying Start and End Positions is op tional. If not specified, the function will return all the values of the specified Repeat variable separated by comma(,)
TDL_Reference_Manual.pdf
What's New in Release 1. 8 61 3 Auto : Yes Title : $$Locale String : "Voucher Configuration" This is a default configuration report marked as Auto report, t o modify variables of parent report. A report can be launched in 'Auto' mode using Actions Modify Variable and Modify System Actions MODIFY V ARIABLE and MODIFY SYSTEM Action-MODIFY V ARIABLE It launches the given report in 'auto' mode. Since the launched report is in 'auto' mode, it cannot have its own instance of variables and any modification would a ffect the parent context. Syntax MODIFY VARIABLE : <Report Name> Where, <Report Name> is the name of the report which is to be launched in 'Auto Mode '. Example: [Button : F2 Change Period] Key : F2 Action : Modify Variables : Change Period Title : $$Locale String : "Period" The Action 'Modify Variable' launches the report 'Change Period ' in 'Auto' Mode. The report is having two fields SVFrom Date and SVTo Date [Field : SVFrom Date] Use : Short Date Field Modifies : SVFrom Date Variable : SVFrom Date [Field : SVTo Date] Use : Short Date Field Format : Short Date, End : #SVFrom Date Modifies : SVTo Date Variable : SVTo Date The variable value changes would affect the parent report conte xt only (i. e., it will affect values of the variables SVFrom Date and SVT odate, which are associated to the report, from which the report Change Period is launched in Auto Mode).
TDL_Reference_Manual.pdf
What's New in Release 1. 8 614 Action-MODIFY SYSTEM The action MODIFY SYSTEM launches the given report in 'auto' mode. Even if the report is called under some other report context, this action makes the new repo rt to get the system context and thereby modify the system scope variables. Syntax MODIFY SYSTEM : <Report Name> Where, <Report Name> is the name of the report which is to be launched in 'Auto Mode '. Example: [Button : Change System Period] Key : Alt+F2 Action : Modify System : Change Menu Period Title : $$Locale String : “Period” The Action 'Modify System' has launched the report 'Change Menu Period' in 'Auto' Mode. The report is having two fields SVFrom Date and SVTo Date [Field : SVFrom Date] Use : Short Date Field Modifies : SVFrom Date Variable : SVFrom Date [Field : SVTo Date] Use : Short Date Field Format : Short Date, End : #SVFrom Date Modifies : SVTo Date Variable : SVTo Date The value changes would affect the variables at system scope, as the report is launched using the Action 'Modify System'. 4. 10 Repeat Line with Optional Collection We are aware that the 'Repeat' Attribute of a Part is used to R epeat a line over a Collection. Existing Syntax Syntax: [Part : <Part Name>] Repeat : <Line Name> : <Collection>
TDL_Reference_Manual.pdf
What's New in Release 1. 8 61 5 Where, <Part Name> is the name of the part. <Line Name> is the name of the line to be repeated. <Collection> is the name of the collection on which the line is repeated. This was mandatory prior to this release. In this case, the same line will be repe ated for each object of the collection. Each line will be associated with an Object of the collection. Report created in Create/Alter/ Display mode will either store method values into the object or fetch method values from the Object. Any expression evaluati on within this line will happen with an object in context. With the introduction of List V ariable (Simple/Compound), there will be a requirement to store values into the V ariable by accepting user inputs and also to d isplay or use it for expression evaluation. Since V ariables are Context free structures there i s no need to associate element variables with the line. For this purpose the 'Repeat' Attribut e of the part has been enhanced to have the collection as Optional. Now, it is possible to Repeat a Line with or without a Collection. In cases where the collection is not specified, the number of lines to be repeated is unknown. Hence, specifying the SET attribute is mandatory. In case of Edit, SET can be optional if 'Break On' is specified. New Enhanced Syntax Syntax [Part : <Part Name>] Repeat : <Line Name> [: <Collection>] Where, <Part Name> is the name of the part. <Line Name> is the name of the line to be repeated. <Collection> is the name of the collection on which the line is repeated. It is now OPTIONAL. Storing Values into List Variables With this enhancement, values can be added to List V ariable (Si mple/Compound) dynamically by accepting user inputs by repeating a line without a Collection. Multiple lines can be added dynamically or a fixed number o f lines can be added as per user requirement, while repeating the line. Example: T o accept the values from a user to the Simple List V ariables S L VEMP, a report is opened in 'Create' Mode. Let us look into the 'Part' Definition: [Part : SLV List Values] Lines : SLV List Title, SLV List Values Repeat : SLV List Values Break On : $$Is Empty : #SLVAlias Scroll : Vertical
TDL_Reference_Manual.pdf
What's New in Release 1. 8 616 Here, the line is repeated without a collection and it will bre ak if the field value 'SL V Alias' is empty. Let us look into the Field Definitions: [Line : SLV List Values] Fields : SLV Alias, SLV Name [Field : SLV Alias] Use : Name Field [Field : SLV Name] Use : Name Field Delete : Key Add : Key : SLV List Key Inactive: $$Is Empty:#SLVAlias [Key: SLV List Key] Key : Enter Action List : Field Accept, SLV List Add [Key : SLV List Add] Key : Enter Action : LIST ADD : SLVEMP : #SLVAlias : #SLVName V alues are added to the List V ariable “SL VEMP” using the Action “ L I S T A D D ”. S i m i l a r l y, u s e r inputs can be added / altered dynamically to the Compound List V ariable also. Retrieving Values from List Variables In the previous example, we had stored values into a Simple List V ariable “SL VEMP”. Let u s suppose that the values need to be retrieved from a Simple List V ariable SL VEMP and displayed in a report. This report “SL V List V alues with Key Display” is opened in 'Di splay' mode. Let us look into the code snippet of the Part definition: [Part : SLVList Values Display] Lines : SLV List Display Title, SLV List Display Values Repeat : SLV List Display Values Set : $$List Count : SLVEmp Scroll : Vertical Common Border : Yes
TDL_Reference_Manual.pdf
What's New in Release 1. 8 61 7 In Part level, the number of lines is fixed using the Attribute 'SET', based on the number of elements in the Simple List V ariable “SL VEmp”. [Line : SLV List Display Values] Fields : SLV Alias, SLV Name [Field : SLV Alias] Use : Name Field Set as : $$List Key:SLVEMP:$$Line [Field : SLV Name] Use : Name Field Set as : $$List Value : SLVEMP : #SLVAlias Key and V alue from the Simple List V ariable “SL VEMP” are retrie ved using the functions $$List Key and $$List V alue at the field level. Similarly, the values can be retrieved from a Compound List V ariable also. 4. 11 Variables in Collection The inline variables can be declared at the Collection using th e Attributes Source V ar, Compute V ar and Filter V ar. In case of Simple Collection, during the evaluation, only current objects are available. Whereas in case of Aggregate/Summary collection, dur ing the evaluation, the following three sets of objects are available: Source Objects : Objects of the collection specified in the 'Source Collection ' attribute Current Objects : Objects of the last collection specified in the Walk path Aggregate Objects : Objects obtained after performing the grouping and aggregatio n There are scenarios where some calculation is to be evaluated b ased on the source object or the current object value and the filtration is done based on the va lue evaluated with respect to the final objects before populating the collection. In these cases, to evaluate the value based on the changing object context is tiresome, and sometimes impossible a s well. The collection level variables provide Object-Context Free proc essing. The values of these inline variables are evaluated befor e populating the collection. The sequence of evaluation of collection attributes has been ch anged to support attributes Compute V ar, Source V ar and Filter V ar. The variables defined using the attributes Source V ar and Compute V ar can be referred to in the collection attributes By, Aggr Compute and Compute. The variable defined by 'Filter V ar' can be referred to in the coll ection attribute 'Filter'. The value of these variables can be accessed from anywhere, while evaluating the current collection objects. Attributes SOURCE V AR, COMPUTE V AR and FIL TER V AR Attribute-Source Var The attribute 'Source V ar' evaluates the value of the variable based on the source object.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 618 Syntax Source Var : <Variable Name> : <Data Type> : <Formula> Where, <Variable Name> is the name of the variable. <Data T ype> is the data type of the variable. <Formula> can be any expression, which eva luates to a value of 'V ariable' data type. Example: Source Var : Log Var: Logical : No The value of the variable 'Log V ar' is set to NO. Attribute-Compute Var The attribute 'Compute V ar' evaluates the value of the variable based on the current objects. Syntax Compute Var : <Variable Name> : <Data Type> : <Formula> Where, <Variable Name> is the name of the variable. <Data T ype> is the data type of the variable. <Formula> can be any expression which evaluates to a value of 'V ariable' data type. Example: Compute Var : IName : String : if ##Log Var then $Stock Item Name else + ##Log Var Attribute-Filter Var The attribute 'Filter V ar' evaluates the value of the variable based on the objects available in the collection after the evaluation of the attributes 'Fetch' and ' Compute'. Syntax Filter Var : <Variable Name> : <Data Type> : <Formula> Where, <Variable Name> is the name of the variable. <Data T ype> is the data type of the variable. <Formula> can be any expression which evaluates to a value of 'V ariable' data type. Example: Filter Var : Fin Obj Var : Logical : $$Number:$Billed Qty > 100
TDL_Reference_Manual.pdf
What's New in Release 1. 8 61 9 4. 12 Using Variable as a Data Source for Collections Collection attribute 'Data Source' has been enhanced to support 'V ariable' as a data source. Now, variable element(s) can be gathered as objects in collection an d their respective simple member variables will be available as methods. Member List V ariables w ill be treated as sub-collections. Syntax Data Source : <Type> : <Identity> [:<Encoding>] Where, <T ype> is the type of data source, i. e., File XML, HTTP XML, Report, P arent Report, V ariable. <Identity> can be file path/ scope keywords/ variable specification, based on type of data source. <Encoding> can be ASCII or UNICODE. It is applicable for data types File X ML and HTTP XML. Example:Simple List Variable as Data Source [Collection : LV List Collection] Data Source : Variable : SLVEmp The elements of the Simple List V ariable 'SL VEmp' will be avail able as objects in the collection 'L V List Collection'. Let us suppose that a Line is repeated over t he collection 'L V List Collection'. The value can be retrieved in the field level as shown below: [Field : SLVEmp Field] Use : Name Field Set as : $SLVEmp Compound List Variable as Data Source [Collection : CV List Collection] Data Source : Variable : CLVEmp The elements of the Compound List V ariable CL VEmp will be avail able as objects in the collection CV List Collection. It is used as a Source Collection in the fo llowing Summary Collection: [Collection : CV List Summary Collection1] Source Collection : CV List Collection Walk : Relatives By : Relation : $Relation Aggr Compute : Max Age : Max : $Age Aggr Compute : Min Age : Min : $Age Aggr Compute : Tot Sal : Sum : $Salary Here, we are walking to the sub-collection 'Relatives' and perf orming grouping and aggregation.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 620 4. 13 Variables in Remoting In a T ally. NET Environment, where T ally at the remote end sends request to the T ally Company at the Server, all client requests must contain the dependencies, based on wh ich data is gathered. In other words, any request sent to the server must accompany the values configured at the client to extract data from the server. For example, a Collection of Ledgers falling under a user selected group must accompany the request sent to the server. Hence, the request to the server must contain the V ariable value wh ich signifies the Group name. Only the configuration information which is relevant to the dat a to be fetched from the Server needs to be sent to the Server, and not the ones which are User Interface related, like Show Vertical Balance Sheet, Show Percentages, etc. When a Collection is sent to the Server, all the dependencies, i. e., variable values, are enclosed within the requests automatically. Example: 1 [Collection : User Ledger Coll] Type : Ledger Child of : ##User Selected Group While sending this collection to the server, the value for the variable User Selected Group is also passed to the server automatically and the server responds acco rdingly. Example: 2 [Collection : Emp Coll] Type : Cost Centre Filter : Emp Spouse Name [System : Formula] Emp Spouse Name : $Spouse Name = ##CLVEMP[1]. Relatives[1]. Name V alue of CL VEMP[1]. Relatives[1]. Name will be enclosed within th e request to the server. In some cases, variable values will not be remoted automaticall y like Child Of : $Func Name, which in turn returns the variable value through the Function. Such variables need to be remoted using an adhoc 'Compute' within the collection. This 'Compute' is required to set a manual dependency on the variable and hence, consider it while sending request to Server. Consider the following example: [Collection : User Ledger Coll] Type : Ledger Child of : $$User Func [Function : User Func] 00 : RETURN : ##Func Var
TDL_Reference_Manual.pdf
What's New in Release 1. 8 62 1 In this example, the function User Func returns the value through the variable 'Func V ar'. Hence, the variable 'Func V ar' needs to be remoted using an adhoc 'Comp ute' as follows: [Collection : User Ledger Coll] Type : Ledger Child of : $$User Func Compute : Func Var : ##Func Var 4. 14 Use Case-Report Configuration Scenario ABC Company Limited, which is into trading business, is using T ally. ERP 9. It deals with purchase and sale of computers, printers, etc. The company management likes to view the Stock Summary Report in various dimensions. Hence, every time, they need to s et configurations for the report and view it. They want to have multiple configurations for the same report and set it at one time. Requirement Statement By default, in T ally, the user has to set the configurations in Stock Summary Report as per the requirement every time. The requirement can be customized using the Compound List V ari able. Functional Demo The solution has been developed using Compound V ariables and Us er Defined Functions. Before looking into the design logic, we will have a functional demo. A new stock summary report is created for demonstration purpose and the same is available as a part of “TDL Language Enhancements” sample TDLs. The TDL is ena bled in T ally. ERP 9. Saving Multiple Configurations Gateway of T ally-> TDL Language Enhancements-> What's New-> Release 1. 8-> Variable Framework-> Stock Summary-> F12. Set the required configuration.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 622 Figure 4. Setting re quired Configurations The above configuration has to be saved using the button Alt+S (Save Config). Enter the Configuration Name and accept it as shown in the following figu re: Figure 5. Saving the Confi guration with a suitable name
TDL_Reference_Manual.pdf
What's New in Release 1. 8 62 3 Similarly, we can save another configuration for the same report, as show n in the following figure: Figure 6. Saving a nother Configuration Retrieving Configuration to view the Report in Different Dimens ions Gateway of T ally-> TDL Language Enhancements-> What's New-> Release 1. 8-> Variable Framework-> Stock Summary-> F12-> Alt+R (Retrieve C onfig). Select the Required Configuration and press Enter. Figure 7. Retrieving and Selec ting the Required Configuration
TDL_Reference_Manual.pdf
What's New in Release 1. 8 624 The configuration will be set automatically as shown in the fol lowing figure: Figure 8. Applying the selected Configuration Accept the screen to view the Report:
TDL_Reference_Manual.pdf
What's New in Release 1. 8 62 5 Figure 9. Report configur ed as per the selection T o view the same Report with another configuration, Press F12-> Alt+R, select the required configuration, and press Enter.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 626 Figure 10. Retrieving and Sel ecting another Configuration The configuration will be set automatically as shown in the fol lowing figure: Figure 11. Applying the selected Configurations Accept the Screen to view the Report.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 62 7 Figure 12. Report configur ed as per the selection Deleting the Configuration Gateway of T ally-> TDL Language Enhancements-> What's New-> Release 1. 8-> Variable Framework-> Stock Summary-> F12-> Alt+D (Delete Con fig). Figure 13. Selecti ng the configuration name for deletion
TDL_Reference_Manual.pdf
What's New in Release 1. 8 628 Select the Configuration to be deleted and press Enter. Figure 14. Confirmation before deleting the selected configu ration Accept it to delete the configuration. Press Alt+R. The report is not displaying the configuration “Detailed Stock Summary” (as shown in the next figure). Figure 15. Report of Configuration List post deletion Solution Development The solution (Setting different configurations for the same rep ort, saving and retrieving them as and when required) was possible by using Compound List V ariable.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 62 9 The steps followed to achieve the requirement are:-1. Defining Compound V ariables with the required members having Persistence behaviour Figure 16. Defining Compound V ariables Declaring Compound List in System Scope Figure 17. Declari ng Compound List V ariable in System Scope
TDL_Reference_Manual.pdf
What's New in Release 1. 8 630 2. Adding Relevant Buttons Figure 18. Adding relevant buttons 3. When the user chooses to save a configuration, Add an element with current Report Name as Key Figure 19. Adding an element to the list variable Add an element within the above element with Config Name (speci fied by user) as Key. Figure 20. Addi ng a sub-element Set the variable values in the current Configuration Screen to the respective Members within the above sub element. Figure 21. Setting the member variable values
TDL_Reference_Manual.pdf
What's New in Release 1. 8 63 1 4. When the user chooses to retrieve a configuration, Display a Report showing the list of available Configurations i n a T able. Figure 22. Report to display list of configurations On selecting the desired configuration, retrieve the saved valu es from the compound varia-ble and set the values to the respective configuration variables. Figure 23. Applying selected c onfiguration values to the Rep ort variables 5. When the user chooses to delete a configuration, Display a Report showing the list of available Configurations i n a T able. On selecting the desired configuration, delete saved values fro m the compound variable. Figure 24. Deleting the sel ected configuration from the List V ariable TDL Capabilities Used User Defined Functions Compound List V ariable
TDL_Reference_Manual.pdf
What's New in Release 1. 8 632 5. Licensing Binding Mechanism Nowadays, it is a common practice to have multiple applications for various business operations at different branches/ locations and then integrate their data and/or reports, as and when required. T ally being the most common and popular product across all indu stries, many Third Party Applications look forward to integrate their applications with Ta l l y. T o ensure a secure environment, Third Party Applications need t o build a robust licensing mechanism in order to validate the users of their application, which may be time consuming and costly. Alternatively, they can opt to use the robust licensing mechan ism already built in T ally and stitch it together with the T ally Application. License Information like T ally Serial Number, Account Email ID, etc., can be retrieved from T ally and validated with the current instance of an external applicat ion. In order to use the T ally licensing mechanism, Third Party Applications need to send vari ous XML Requests to T ally running at a predefined IP Address and a Port. On receiving the XML Request in T ally understandable format, T ally responds with the required informa tion, data or Report requested. The various approaches for retrieving License Information from T ally that can be followed by Third Party Applications have been broadly classified based on the de sired level of security, ranging from simple to the most complex one. The Approaches that can be used by Third Party Applications to retrieve License Information from Ta l l y, based on the level of Security desired, are as follows: 5. 1 License Info Retrieval using Open XML This approach is one of the simplest approaches with minimal se curity wherein the Third Party Applications will be able to send an XML Request to invoke plat form functions in T ally to retrieve the required License Information. This is a less secured enviro nment, as the license data returned will be available as an Open XML In T ally, a platform function $$License Info is available which accepts a parameter to determine the type of License details required and returns the value acco rdingly. F o r e x a m p l e, $$License Info:Serial Number returns the Serial Number of the running copy of T ally. Code Snippets have been extracted from the working solution provided with the Samples. For any further information on XML Formats, please refer to the documents and samples available at www. tallysolutions. com in the path Developer Network-> Tally Technology-> Integration Capabilities.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 63 3 Following is the list of parameters allowed for the Function $$License Info: The following XML Request is required to fetch T ally Serial Num ber: <!--XML Request--> <ENVELOPE> <HEADER> <VERSION>1</VERSION><TALLYREQUEST>EXPORT</TALLYREQUEST> <TYPE>FUNCTION</TYPE> <!--Platform Function Name in Tally. ERP 9--> <ID>$$License Info</ID> </HEADER> <BODY>Parameters permissible for License Info Return Type Description Serial Number Number Serial Number Account ID String Account ID Site ID String Site ID Admin Email ID String Admin Email ID Is Admin Logical Whether the System logged in user is Administrator or not Is Indian Logical Whether the country is India or not Is Silver Logical Whether the Product flavour is Silver or not Is Gold Logical Whether the Product flavour is Gold or not Is Educational Mode Logical Whether the Product is running in Educational mode Is Licensed Mode Logical Whether Product is running in Licensed mode Lic Server Date Date License Server Date Lic Server Time String License Server Time Lic Server Date Time String Li cense Server Date & Time
TDL_Reference_Manual.pdf
What's New in Release 1. 8 634 <DESC> <FUNCPARAMLIST> <!--Parameter for the function $$License Inf o--> <PARAM>Serial Number</PARAM> </FUNCPARAMLIST> </DESC> </BODY> </ENVELOPE> The previous XML Request fetches the following XML Response: <!--XML Response--> <ENVELOPE> <HEADER> <VERSION>1</VERSION> <STATUS>1</STATUS> </HEADER> <BODY> <DESC></DESC> <DATA> <RESULT TYPE="Long">790003089</RESULT> </DATA> </BODY> </ENVELOPE> In this response received from T ally, Serial Number is retrieved within the RESUL T Ta g. Similarly, to fetch the Account ID of the current T ally Application, repl ace the Parameter Serial Number with Account ID within Param T ag in the XML Request. 5. 2 License Info Retrieval usi ng Encoding Procedure built in a TCP This approach is a slightly be tter approach than the previous o ne, since the Response received here is encoded using some encoding mechanism built within TDL.
TDL_Reference_Manual.pdf
What's New in Release 1. 8 63 5 The Third Party Application will send a V alidation String withi n the XML Request. At T ally's End, the validation string and the required License Info will be enc oded using the encoding mechanism built within TDL. The converted Strings will then be sent back within the XML Re sponse to the Third Party Applications, which will decode the strings at thei r end. Following needs to be made available for this approach to be ex ecuted: At T ally End A TDL needs to be written containing the encryption mechanism t o encrypt a string. Following is an example of Stri ng encryption in T ally using TDL Function: ;; TDL Function to Encrypt an input String, by reversing it [Function : Str Enc] Parameter : p Stringto Reverse : String Variable : Reverse String : String00 : FOR RANGE : Iterator Var : Number : ($$String Length: + ##p Stringto Reverse-1) : 0: 1 10 : SET : Reverse String : ##Reverse String + $$String Part:+ ##p String To Reverse : ##Iterator Var:1 20 : END FOR 30 : RETURN : ##Reverse String This was a simple example of String encryption in T ally. Similarly, much robust encryption mechanisms can be built in TDL and used in Third Party Applicat ions. Report having a string variable, and triggering the encrypt fun ction with string variable as a parameter, returning the encrypted value within the required XML T ags. ;; TDL Report to invoke the above Function [Report : Sec XML Request2] Form : Sec XML Request ;; Variable for received String Variable : Enc String: String [Form : Sec XML Request] Parts : Sec XML Request [Part : Sec XML Request] Lines : Sec XML Req Serial No, Sec XML Req Enc String Scroll : Vertical
TDL_Reference_Manual.pdf
What's New in Release 1. 8 636 XMLTAG : "TALLYLICENSEINFO" ;; Serial Number of Tally [Line : Sec XML Req Serial No] Fields : Name Field Local : Field : Name Field : Set As : $$Str Enc:@@Lic Sl No Local : Field : Name Field : XMLTAG : "Serial Number" ;; To Encrypt the received String [Line : Sec XML Req Enc String] Fields : Name Field Local : Field : Name Field : Set As : $$Str Enc:##Enc String Local : Field : Name Field : XMLTAG : "Encrypted String" On receiving the XML Request, the report is executed and both the Serial Number and the Stri ng received within the XML Request are encrypted and sent back to Third Party Applications. At Third Party Application End An XML Request to trigger the T ally Report with request String to be encrypted. Following XML Request triggers the previous Report associated with T ally: <!--XML Request--> <ENVELOPE> <HEADER> <VERSION>1</VERSION> <TALLYREQUEST>Export</TALLYREQUEST><TYPE>Data</TYPE> <ID>Sec XML Request2</ID> </HEADER><BODY><DESC> <STATICVARIABLES> <SVEXPORTFORMAT>$$Sys Name:XML</SVEXPORTFORMAT><Enc String>Keshav</Enc String> </STATICVARIABLES>
TDL_Reference_Manual.pdf
What's New in Release 1. 8 63 7 </DESC> </BODY> </ENVELOPE> Sec XML Request2 is the TDL Report which is requested and variables SVExport Format (format in which response is required) and Enc String (V ariable Name specified in TDL Report for string to be encrypted) are enclosed within the XML Request. The following response is received from T ally on sending the ab ove request <!--XML Response--> <ENVELOPE> <TALLYLICENSEINFO> <SERIALNUMBER>980300097</SERIALNUMBER><ENCRYPTEDSTRING>vahsek</ENCRYPTEDSTRING> </TALLYLICENSEINFO> In this response, Serial No. and String sent as request are ret urned encrypted, i. e., reversed from T ally. On receiving the response, the Third Party Application needs t o decrypt the Serial Number as well as String and validate the current instance. It is a much secure environment as the response is in encrypted form. 5. 3 License Info Retrieval usin g Encryption Functions provided within T ally This Approach is similar to the previous approach except that i t uses an inbuilt Platform Function to encrypt the string. In T ally, the validation string and the required License Info can be enc rypted using the function $$Encrypt Str provided within the platform. The encrypted Strings will be sen t back within the XML response to the Third Party Application. Th e Third Party Application will decrypt the Strings at their end using the standard DLL shipped by T ally for decryption. XML Request is similar to the Request in the previous approach, except that: An additional variable value Password must be specified with th e XML T ag Password (V ariable Name used in TDL Report for Password), and The requested Report triggers the platform function $$Encrypt Str for encryption mechanism. A supporting DLL File Encrypt Decrypt. DLL is provided along with Sample Files to decrypt the Encrypted String in T ally, using the Function $$Decrypt Str available in DLL. This Function accepts 4 parameters viz., Input String to be decrypted Password specified while encoding an XML request Output String V ariable to hold the decrypted return V alue Output String Buffer Length
TDL_Reference_Manual.pdf
What's New in Release 1. 8 638 On decrypting the above string, the Third Party Application can validate the returned String a nd Serial Number, and continue if the validation is successful. 5. 4 License Info Retrieval using Encryption Algorithms built u sing Third Party DLLs This Approach is the most secured approach, wherein an external DLL is written to encrypt the given string. The Third Party Application will send a V alidatio n String within the XML Request. At T ally's End, the validation string and the required License Inf o will be encrypted using an External DLL, which can have its own Encryption Routines. T ally uses the function $$Call Dll Function to trigger the DLL written for encryption and returns the encrypted strings to the Third party Application within the XML Response. At Third Party Application End, decryption algorithms will be required, which can again be provided inside the same DLL used for encryption. Function-$$Call DLLFunction The Platform Function Call DLLFunction is used to trigger the function enclosed within an external DLL (written in C++/VC++) Syntax $$Call DLLFunction : <DLL Name> : <Function Name> : <Param 1> : + <Param 2> :... <Param N> Where, <DLL Name> is any DLL written in C++/VC++, <Function Name> is a Function available in the DLL, <Param 1 to N> are arguments, which depend upon the number of parameters neede d by the Function designed. XML Request for this approach is similar to the Request in the previous approach, except that The requested Report triggers the function written within DLL f or encryption mechanism using Call DLLFunction. Subsequently, the Third Party Application can decrypt the encrypted String a nd the Serial Number using the decrypt function within the same DLL or any other DLL. The above DLL can be copied either to the local path of the Third Party Application or to the Windows System Directory. DLL must exist in the Tally Applicatio n folder or Windows System Folder.
TDL_Reference_Manual.pdf
639 What's New in Release 1. 61 1. Narrowing T able Search The current search capability on a T able allows the user to hig hlight a particular set of items based on the search text entered in the field. The text is searched f rom the beginning of the item names in the list and is applicable to the first column only. In a scenario where there are large number of items in the list /table, it is impossible for the user to remember the starting characters of the item names. He may reme mber only a part of the item name which he requires to search. Even after the relevant items are searched and highlighted, all the items are displayed, which is not required. The latest enhancement in TDL allows the user to search a text from any part of the item name which appears in the list. The table keeps on narrowing down an d displaying only those items which fulfil the search criteria. It is also possible now to sp ecify whether the search criteria should be applicable on first column or all columns of the table. 1. 1 Field Attribute-T able Search A new field attribute called 'T able Search' has been introduced to achieve the above capability. Syntax [Field : <Field name>] Table Search : <Enable reducing table search> : <Apply search to all + columns> Where, <Enable reducing table search> is a logical value (YES/NO), to specify whether we want to enable the reducing of search or not. <Apply search to all columns> is a logical value (YES/NO), to specify whether the search criteria should apply to all columns of the table or not. 1. 2 Function-$$T able Num Items A new function $$T able Num Items has been introduced which return s the number of items in the list/table. Example: [Collection : RTS Ledger] We can also use expressions in attribute values which evaluate to logical values.
TDL_Reference_Manual.pdf
What's New in Release 1. 61 640 Type : Ledger Format : $Name Format : $Parent Format : $Closing Balance [Field : Reducing Table Search GT 100] Use : Name Field Table : RTS Ledger Show Table : Always Table Search : $$Table Num Items > 100 : Yes In this example, the field 'Reducing T able Search GT 100' is di splaying the table 'RTS Ledger', which has three columns 'Name', 'Parent' and 'Closing Balance'. The attribute 'T able Search' evaluates the first value to YES, only when the number of items in the table exceeds 1 00, i. e., reducing search will be enabled if this criteria is met. The second attribute value is set to YES, i. e., the search criteria will apply to all columns in the table. 1. 3 Functionality Achieved Using the above capability, it has been possible to deliver the functionality of applying the above search technique to all the tables available in the default pro duct. This will of course be based on the configuration settings selected by the user. 1. 4 Use Cases 1. Company search based on the Company ID. 2. Ledger search based on parent Group name available in other c olumn in a table. 3. While selecting the Stock item Name in a voucher, the user can now narrow the search, based on the UOM and make his selection of item based on the closing balance available for that UOM.
TDL_Reference_Manual.pdf
641 What's New in Release 1. 6 In this release, there have been enhancements in User Defined F unctions, Collections and Actions. We will see in depth the changes for the Actions-Print, Upload, Export and Mail. It is now possible to program the configurations for these Actions. T his breakthrough capability has enabled to deliver the mass mailing feature in the product T all y. ERP 9. Collection attribute Keep Source is enhanced to accept a new value, i. e., Keep Source : (). This has been done with the aim to improve the performance. The Loop Collection capability has paved the way for displaying and operating on Multi-Company Data, alo ng with ease of programming. The TDL language has been enriched with more and more procedura l capabilities by introducing the Function $$Loop Index and Looping construct FOR RANGE. There have been some changes in the Action NEW OBJECT as well. With the introduction of the function $$Sys Info, it is now possible to retrieve all system-related information consistently using a single function. 1 General Enhancements 1. 1 Programmable Configuration for Actions-Print, Export, Mail, Upload In T ally. ERP 9, the Actions Print, Export, Mail and Upload depend upon various parameters like Printer Name, File Name, Email T o, etc. Prior to execution of t hese actions, the relevant parameters are captured in a Configuration Report. These parame ters are persisted as system variables, so that the next time, these can be considered as default setti ngs. There are situations when multiple reports are being printed or mass mailing is being done in a sequence. Subsequent to each Print or Email Action, if a configuration report is popped up for user inputs, this interrupts the flow, thereby requiring a dedicated person to monitor the process, which is time-consuming too. This issue has been addressed in the recent enhancements in T ally. ERP 9, where the configuration report can be suppressed b y specifying a logical parameter. Also, the variables can be set prior to invoking the desired ac tion. Before exploring the new enhancements, let us see the existing behaviour of the actions Print, Email, Export and Upload. Existing behavior of Actions-Print, Export, Mail, Upload Presently, in T ally. ERP 9, whenever any of these actions is invoked, a co mmon Configuration report SVPrint Configuration is displayed to accept the user inputs. The user provides the details in the configuration screen, based on the action being executed. The action gets executed based on the values provided in the configuration report. The existing syntax of these actions was: Syntax <Action Name> : <Report Name> Where, <Action Name> can be any of Mail, Upload, Print or Export.
TDL_Reference_Manual.pdf
What's New in Release 1. 6 642 <Report Name> is the name of the Report. For successful execution of these actions, along with the Repor t Name, additional action-specific parameters are also required. These action specific parameters are passed by setting the values of variables through the configuration report-'SVPrint Configuration'. The default configuration report 'SVPrint Configuration' is invo ked only when the Report specified does not contain the Print attribute in its own definition. The 'Print' attribute allows the user to specify his own configuration settings, whenever any of these A ctions is invoked. Example: Mail : Balance Sheet The action Mail needs information regarding the T o e-mail ID, From e-mail ID, C C e-mail ID, Email server name, etc., which are provided through the Configu ration report. For example, a report needs to be mailed to multiple e-mail IDs in one go. Currently, for every mail, the configuration screen is displayed, and every time, the user has to manually provide T o email ID, From email ID, etc. So, whenever any of the above act ions is executed, a configuration report is displayed, which requires user inputs. In some scenar ios, this behaviour is not desirable. Configuration settings can be specified once, and the user shou ld be able to use it multiple times. The action syntax has been enhanced to avoid the display of configuration screen repeatedly. Changes in the Actions for Programming Configurations The global actions Print, Export, Mail and Upload have been enhanced to suppress the Configuration Screen. These actions now accept an additional lo gical parameter. Based on the value of the logical parameter, the configuration report is suppressed. The new enhanced syntax of these actions is: Syntax <Action Name> : <Report Name> : <Logical Value> Where, <Action Name> can be any of Mail, Upload, Print or Export. <Report Name> is name of the Report. <Logical Value> can be TRUE, FALSE, YES or NO. With the new syntax, it is possi ble to configure the values of the report only once and then mail it to the specified e-mail addresses, without repeated display of the configuration report. Example: 10 : MAIL : Ledger Outstandings : TRUE As the Configuration Report is not displayed, the values of the mail action specific variables like 'SVPrint File Name ', 'SVOutput Name ', etc., must be specified for the successful execution of these actions. Following are the action-specific variables and their acceptabl e values: The Configuration Variables-Action Specific
TDL_Reference_Manual.pdf
What's New in Release 1. 6 64 3 The action-specific V ariables can be classified into four categories based on their usage. Common Variables SVOutput T ype-The value of this variable is one of the predefined button typ e keywords like Print Button, Export Button, Upload Button and Mail Button. The variables' value is used by the functions $$In Mail Action, $$In Print Action, $$In Upload Action and $$In Export Action to determine the execution of the correct option in the form 'SVPrint Configu ration'. For example, if the value of 'SVOutput Type' is 'Print Button', then the optional form 'SV Pr int Config' in the report 'SVPrint Configuration' is executed. SVPrint File Name-This variable accepts the output location as value. The value of this variable is specific to each action. The usage of each action is explain ed in detail, along with the action. SVExport Format-The value of this variable is the name of the format to be use d with the actions Mail, Upload and Export. The values are SDF, ASCII, HTML, EXCEL, XML, Ansi SDF, Ansi ASCII, Ansi XML, Ansi HTML and Ansi Excel, which are set using $$Sys Name. Example: 01 : SET : SVExport Format : $$Sys Name:Excel SVExcel Export Update Book-This is a logical value and can be used only if the 'Excel' fo rmat is used. If the value is set to YES, then the existing file is ove rwritten; otherwise, it will ask for "Overwrite" confirmation. SVBrowser Width, SVBrowser Height-These variables are used to set the width and height of the page when the format is HTML. Variables Specific to Action-Print As soon as the user executes a Print action, the following scre en is displayed: Figure 1. Print Screen This screen captures the user inputs such as the "Printer Name", "No. of Copies" to be printed, etc. The various action specific variables required by the 'Pri nt' action are modified, based on the user inputs. Following variabl es are used by Print action: SVPrint Mode-This variable used by 'Print' action accepts the printing mode as the value. The Print mode can be 'Neat', 'DMP' or 'Draft', which are system na mes. Default mode is Neat mode. SVPrint File Name-This variable is applicable for 'Print' action, only if 'Print T o File' option is selected by the user, while printing in DOT Matrix or Quick/Draft format. In this case, the variable 'SVPrint File Name' accepts filena me using function $$Make Export N ame, to add right extensions.
TDL_Reference_Manual.pdf
What's New in Release 1. 6 644 SVPrint T o File-This is a logical value which determines if the print output s hould be saved in a file. If the value is TRUE, the output is saved in the file spe cified in the variable 'SVPrint File Name'. If the vale is FALSE, then the variable 'SVPrinter Name' must conta in a valid printer name. SVPrinter Name-It accepts a printer name as a value for printing. The default value is taken from the system settings available in Control Panel for Printers and Faxes. SVPreview-This is a logical variable and is applicable only for 'Print' action with 'Neat' mode format. If the value is set to YES, then the preview of the rep ort is displayed. Otherwise, the report is printed, without displaying the preview. SVPrint Copies-It is applicable only for 'Print' action. It accepts a number to print multiple copies. SVPre Printed-The variable is applicable only for 'Print' action, and it spe cifies whether a pre-printed stationary or plain paper is to be used for printin g. SVPrint Range-It is applicable only for Print action. It determines the range of pages to be printed. SV Draft Split Names-It accepts a logical value to determine if the long names shou ld be split into multiple lines. SV Draft Split Numbers-It accepts a logical value to determine if the long numbers sh ould be split into multiple lines. SVPrint Start Page No-It is applicable only for Pri nt action. It allows to specify starting page no. SVPos Mode-It determines if POS mode is to be used. The default value of this variable is NO. Variables Specific to Action-Export The following screen is displayed when the user executes ' Export ' action. Figure 2. Export screen This screen captures the user inputs such as "Export Format","O utput File Name", etc. The action 'Export' uses the variables 'SVExport Format', 'SVPrint Fi le Name', etc. SVPrint File Name-For the Export action, the value of this variable is the outpu t file name. The path can be specified directly, or the function $$Make Export Name can be used to create the output path. The function $$Make Export Name suffixes the extensi on based on the export format, if only the file name is passed as a parameter. Syntax
TDL_Reference_Manual.pdf
What's New in Release 1. 6 64 5 $$Make Export Name : <String Formula> : <Export format> Where, <String Formula> is a string formula which evaluates to the path\filename. <Export format> is the name of the format which h as to be used while exporting. Example: $$Make Export Name : "C: \Tally. ERP\abc. xls" : Excel Variables Specific to Action-Mail When the user executes 'Mail' action, following screen is displ ayed to capture the mailing details: Figure 3. Mail Screen For successful execution of 'Mail' action, user has to enter th e above details. The URL is then created using function $$Make Mail Name, and the value is stored in variable 'SVPrint File Name'. SVPrint File Name-This variable accepts the URL location as value. Function $$Ma ke Mail Name is used to construct the URL. The mail is sent to specified mai l addresses using the given server. Syntax $$Make Mail Name : <To Address> : <SMTP Sever name> : <From Address>: + <CC Address> : <Subject>:<Username> : <Password> : <Use SSL flag> Where, <T o Address> is the e-mail id of the receiver. <SMTP Server Name> is the name of the server from which the mail is sent. <From Address> is the sender's e-mail id. <CC Address> is the email-id where the copy of the mail is to be sent. <Subject> is the subject of the mail. <User Name> is the user id on the secured server.
TDL_Reference_Manual.pdf
What's New in Release 1. 6 646 <Password> is the password for the user id on the secured server. <Use SSL Flag> can be TRUE /FALSE OR YES/NO. If the Use SSL flag is set to TRUE, then the Username and Password must be specified, i. e., they can't be em pty. Example: $$Make Mail Name : "abc"+ "<" +" abc@abc. com" + ">" smtp. gmail. com" : + "abc@gmail. com" : "" : "Your outstandingpayment" : + abc@gmail. com : abc123 : True Variables Specific to Action-Upload Following screen is displayed to capture details of the folder where the report is to be uploaded: Figure 4. Upload Screen Based on information entered by the user, the URL of the upload site is created using function $$Make HTTPName or $$Make FTPName, and the value is stored in var iable 'SVPrint File Name'. SVPrint File Name-It accepts the URL of upload site. The URL is constructed using the functions $$Make HTTPName or $$Make FTPName, depending on protocol selected by the user for upload. Function $$Make FTPName is used for creating the file transfer protocol, based on speci fications. Syntax $$Make FTPName : <Ftp Server> : <Ftp User> : <Ftp Password> : <Ftp Path> Where, <Ftp Server> is the FTP server name. <Ftp User> is the FTP user name. <Ftp Password> is the FTP password. <Ftp Path> is the full path of the folder on the FTP server. Example:
TDL_Reference_Manual.pdf
What's New in Release 1. 6 64 7 $$Make FTPName : "ftp://ftp. microsoft. com" : "" : "" : "dbook. xml" Function $$Make HTTPName is used for creating the Hyper T ext Transfer Protocol for the specified security features. Syntax $$Make HTTPName : <Http Url> : <Http Is Secure> : <Http User Name> : + <Http Password> : <Company Name> Where, <Http Url> is the HTTP URL name. <Http Is Secure> is a logical attribute which chec ks whether the HTTP is secure or not. <Http User Name> is the HTTP user name. <Http Password> is the HTTP password. <Company Name> is the name of the Company. Example: $$Make HTTPName : "https://www. abc. com" : Yes : "guestuser" : "pswd99" : "ABC Company Ltd" Use Case Scenario : Report "Bill-wise details" is to be mailed to each party with t heir respective Bill Details. However, mails to all parties should be sent at one key stroke, without the e-mail configuration screen popping up multiple times. As of now, a user has to manually enter email IDs for each ledger. Solution: Following steps need to be implemented: Step 1: Create Function [Function : Func Emailing Outstanding] Variable : Ledger Name : String Step 2: Create Local Formulae for enhanced readability of code Local Formula : From Address : "abc" + "<abc@abc. com>" Local Formula : To Address : if $$Is Empty : $Email then "abc@abc. com" else $Email Local Formula : Subject : ##Ledger Name + "(Bill-wise Details)" Step 3: Set the values of common variables used in 'Mail' action 03a : SET : SVExport Format : $$Sys Name : HTML Step 4: Walk the Ledger Collection to retrieve the email-id of the ledg er 01 : WALK COLLECTION : SDLedger Step 5: Set the values of the variables used in 'Mail' action
TDL_Reference_Manual.pdf
What's New in Release 1. 6 648 02 : SET : Ledger Name : $Name 03b : SET : SVMail Embed Image : @@As Attach 03c : SET : Explode Flag : "Detailed" 03d : SET : SVPrint File Name : $$Make Mail Name : @To Address : + “smtp,gmail. com” : @From Address : "admin@tallysolutions. com" : + @Subject : "" : "" : FALSE Step 6: Call the action 04 : MAIL : Ledger Outstandings : TRUE ;; TRUE is meant to suppress the configuration report 06 : END WALK | | 08 : RETURN 2 Collection Enhancements In Collection definition, attributes Keep Source and Collection have been enhanced. The collection attribute 'Keep Source' has been enhanced to accept a new value, i. e., Keep Source: '(). ' to make the data available at Primary Object, which can be a Menu, Report or Function. The Collection definition can now use a new capability to loop one collection for each object of another collection. This functionality has been introduced by e nhancing the 'Collection' attribute. 2. 1 'Collection' Attribute Value-Keep Source: (). Attribute 'Keep Source' accepts various values used to specify the In memory source retention of the collection. Specifications like.,..,Ye s , No, etc., were used earlier for this. The source collection was retained along with data object associated with the User Interface object in the current User Interface object hierarchy, as per specification. The newly introduced specification "(). " is used to keep the source collection with the parent UI object, w hich is either Report or Function. The dotted notation depends on the interface object hierarchy. If there are recursive explodes in a report, then it is difficult to use the dotted notation when th e data is to be kept at Report or Function level. The new value Keep Source : (). has been introd uced to overcome this issue. Keep Source : (). signifies that the collection data has to be kept available at primary level, which can be Menu or Report or Function. So, now 'Keep Source' attrib ute accepts the following values: Keep Source: NO-The source collection data is not kept in memory. Keep Source: YES-The source collection data is kept in the object associated wi th the current interface object.
TDL_Reference_Manual.pdf
What's New in Release 1. 6 64 9 Keep Source: ().-The source collection data is kept in the data object associate d with the primary owner interface object, i. e., Menu or Function or Repor t. Keep Source:....-Each dot in the notation is used to traverse upward in the owne r chain by the number of dots specified, till a primary interface objec t is found. In scenarios where the data is to be kept at Primary interface object, the application developer can directly use Keep Source : (). without worrying about the i nterface object hierarchy. Example: | [Part : TB Report Keep Src Part] Lines : TB Report Keep Src Title, TB Report Keep Src Details Bottom Lines : TB Report Keep Src Total Repeat : TB Report Keep Src Details:TB Report Keep Src Groups Pri The line repeats on collection ' TB Report Keep Src Groups Pri ', which displays all the groups belonging to Primary group. The li ne then explodes to display t he subgroups. [Line : TB Report Keep Src Details] Explode : TB Report Keep Src Group Explosion : $$Key Explode In the part 'TB Report Keep Src Group Explosion', if the object is Group, then once again the line explodes to display the sub-groups or the ledgers belonging to the current sub group. [Part : TB Report Keep Src Group Explosion] Lines : TB Report Keep Src Details Explosion Repeat : TB Report Keep Src Details Explosion:TB Report Keep Src Sub Grp Scroll : Vertical [Line : TB Report Keep Src Details Explosion] Explode : TB Report Keep Src Group Explosion : $$Key Explode Explode : TB Report Keep Src Ledger Explosion : $$Key Explode Indent : If $$Is Group Then 2*$$Explode Level Else 3* $$Explode Level Local : Field : Default : Delete: Border The part ' TB Report Keep Src Group Explosion' is exploded recursively. So, it Is useful to keep the data at the primary interface object level. The collections 'TB Report Keep Src Groups Pri' and 'TB Report Keep Src Sub Grp' both use the same source collection 'TB Report Keep Src Groups'. The collections are defined as follows: [Collection : TB Report Keep Src Groups]
TDL_Reference_Manual.pdf
What's New in Release 1. 6 650 Type : Group Fetch : Name, Parent, Closing Balance [Collection : TB Report Keep Src Groups Pri] Source Collection : TB Report Keep Src Groups Filter : Primary Grp By : Name: $Name Compute : Parent: $Parent Keep Source : (). [Collection : TB Report Keep Src Sub Grp] Source Collection : TB Report Keep Src Groups Filter : Sub Grp By : Name : $Name Compute : Parent : $Parent Keep Source : (). [Collection : TB Report Keep Src Ledgers] Type : Ledger Child Of : #My Group Name1 Filter : Zero Filter Fetch : Name,Parent, Closing Balance [System : Formula] Zero Filter : $Closing Balance > 0 AND NOT $$Is Ledger Profit Primary Grp : $$Is Sys Name Equal : Primary : $Parent Sub Grp : $Parent = #My Group Name1 2. 2 Attribute 'Collection' change-Loop Collection The data processing artefact of TDL, i. e., 'Collection', provides extensive capabilities to gather data from various data sources. The TDL application developers are aware that the source can be report, parent report, collection/s and external data sources l ike excel, XML, etc. It is possible to gather the data from multiple collections in one collection. Till this enhancement, the collection didn't directly support the capability to gather data dynamically from multiple collections based on the object context of another collection. The functionality was achieved
TDL_Reference_Manual.pdf
What's New in Release 1. 6 65 1 using 'Filter' and 'Child Of' attributes of the 'Collection' definiti on. Programming using these was tedious and time consuming, and increased the code complexity as well. The new enhancement has simplified the TDL code development. The 'Collection' attribute of 'Collection' definition has been enhanced to repeat and combine the same collection based on the number and context of objects in a nother collection. The present syntax of 'Collection' attribute allows us to combine and colla te the data from all the collections specified as a comma-separated list, provided the number, order and data type of methods are the same in each of the coll ection specified in the list. Existing Syntax The existing syntax of 'Collection' attribute is as below: Syntax [Collection : <Collection Name>] Collection : <List of Data Collection> Where, <Collection Name> is the name of the collection. <List of Data Collection> is the comma-separated list of data collections. Example: [Collection : Group Led Coll] Collection : Test Groups, Test Ledgers In this example, the Collection 'Group Led Coll' will contain the union of objects from both the collections 'T est Groups' and 'T est Ledgers'. The Collection attribute has been enhanced to dynamically gather the data coll ections in the context of each object of another collection. It now accepts tw o additional optional parameters. New Enhanced Syntax The new enhanced syntax of the 'Collection' attribute is as given below: Syntax [Collection : <Collection Name>] Collection : <List of Data Collection> [:<Loop Coll Name> [:+<Condition for Loop Coll]] Where, <Collection Name> is the name of the collection. <List of Data Collection> is the comma-separated list of data collections. <Loop Coll Name> is the name of the loop collection, and is optional. <Condition for Loop Coll> is optional. The condition is evaluated on each object of the L oop Collection. The attribute 'Collection' has been now enhanced to repeat a co llection over objects of another collection. Optionally, a condition can be specified. This condition applies to the collection on
TDL_Reference_Manual.pdf
What's New in Release 1. 6 652 which looping is desired. The collection on which the repetitio n is done is referred to as Loop Collection. The collection names in the list of collections are referred to as Data Collections. The data is populated in the resultant collection from the list of data collections. Each data collection is gathered once for each object in the lo op collection. If there are n objects in the loop collection, the data collections are gathered n tim es in the context of each object in the loop collection. In the resultant collection, the objects are d elivered as TDL Objects. This makes it mandatory to fetch the required methods in the Data Collection. Example: [Collection : Vch Of Multiple Ledgers] Collection : Vch Of Ledger : Ledger List Coll : ($Parent starting with "Sundry") [Collection : Vch Of Ledger] Type : Vouchers : Ledger Child of : $Name Fetch : Voucher Number, Date, Amount The collection Vchof Ledger is the data collection. It is mandatory to fetch the required m ethods 'Voucher Number', 'Data' and 'Amount', in order for them to be available in the resultant collection. It can be observed that the method $name of loop collection Ledger List Coll is used in 'Child Of' attribute directly. This is because while the evaluation of 'Child Of' attribute, t he loop collection object context is available. If we are referring to the methods of the loop collection dire ctly in the attributes SOURCE V AR, COMPUTE V AR, COMPUTE, AGGR COMPUTE, FIL T ER and FIL TER V AR, we cannot do so. This is because while evaluating these at tributes, the loop collection object context is not available. In order to make these methods availa ble in the Data collection, t h e following function has been introduced. New Function-$$Loop Coll Obj Function-$$Loop Coll Obj The function $$Loop Coll Obj has been introduced to refer to any method of the Loop Collection objects in the Data Collection. The Data Collection can use thi s function for the evaluation of expressions. Syntax $$Loop Coll Obj : <Method name from Loop Coll Obj> Where, <Method name from Loop Coll Obj> is name of method from the object of the loop collection. Example:A collection is created to gather all the vouchers of all the l oaded companies as follows: [Collection : Vouchers of Multiple Companies] Collection : Vch Collection : Company Collection
TDL_Reference_Manual.pdf
What's New in Release 1. 6 65 3 Sort : Default : $Date, $Ledger Name Objects in collection 'Vouchers of Multiple Companies' are sort ed based on date and ledger name [Collection : Vch Collection] Type : Voucher Fetch : Date, Vouchernumber, Voucher Type Name, Amount, Master ID, + Ledger Name Compute : Owner Company : $$Loop Coll Obj : $Name Let us examine the Data Collection definition “Vch Collection”. When the attribute 'Compute' is evaluated, the Loop collection object context is not available here. So, to refer to the Company Name, the function $$Loop Coll Obj is mandatory. [Collection : Company Collection] Type : Company Fetch : Name Use Case Scenario: A Stock Summary Report for Group Company. The consolidated stock summary report of all the members of a g roup company. The member companies of the group company can have different Unit of Measu res and Currency. Solution: The report displays stock item name, unit of measurement and combined closing balance of all members of the group company, assuming that the base currency is same. At part level, the line is repeated on the aggregate/summary collection Grp Cmp SSRepeat Coll as follows: [Part : Grp Cmp SSPart] Line : Grp Cmp SSLine Title, Grp Cmp SSLine Details Repeat : Grp Cmp SSLine Details : Grp Cmp SSRepeat Coll Scroll : Vertical Common Border : Yes The summary collection is defined as follows: [Collection : Grp Cmp SSRepeat Coll] Source Collection : Grp Cmp SSLoop Collection By : Stk Name : $Name By : UOM: $Base Units Aggr Compute : Cl Bal : SUM : $Closing Balance Sort : Default : $Stk Name, $UOM
TDL_Reference_Manual.pdf
What's New in Release 1. 6 654 Since the member companies may have different UOM, the grouping is done on the same. If the UOMs are same then the 'Closing Balance' is aggregated, else the Items are displayed as separate line items with respective UOMs. The source collection 'Grp Cmp SSLoop Collection' is defined as follows: [Collection : Grp Cmp SSLoop Collection] Collection : Stk Coll : Grp Cmp Coll The data collection ' Stk Coll' is gathered for each object of the loop collection 'Grp Cmp Coll'. The collections are defined as follows: ;; Data Collection [Collection : Stk Coll] Type : Stock Item Fetch : Name, Base Units, Closing Balance ;;Loop Collection [Collection : Grp Cmp Coll] Type : Member List : Company Child Of : ##SVCurrent Company Assume that currently a group company Grp ABC is loaded with three member companies A, B and C. The Stock Items details in each company are shown in fol lowing table:We cannot perform aggregation directly on the resultant collection (which is created using data and loop collection). If required to do so, the same has to be used as a source collection for the a ggregate/summary collection. Company Name Stock Item Unit of Measure Closing Balance Company A Item 1 Nos 500 Item 2 Kg 500Item 3 Nos 500 Company B Item 1 Nos 400 Item 3 Nos 800 Company C Item 1 Nos 300 Item 2 Nos 700Item 3 Nos 500
TDL_Reference_Manual.pdf
What's New in Release 1. 6 65 5 The following table demonstrates the objects in each collection : Multi Column behavior with Multi-Company data V arious reports can be generated in T ally. ERP 9 relevant to the user's business requirement. All the reports are generated in context of SVCurrent Company, SVFrom Date and SVT o Date. In the multi column report, the collection is gathered for each column of the report. The code complexity has been reduced with the introduction of Loop Colle ction in TDL language. When the Data collections are gathered in the context of Compan y as Loop collection; in the resultant collection, the object context is forcefully changed to current/owner/loaded company and the report is displayed. Consider the following example to understand the Loop Collectio n behaviour of multi column report for multiple companies. Assume that there are three comp anies A, B and C. The company A has ledgers L1 and L2, B has ledgers L3 and L4, while C has ledgers L5 and L6. The cu rrently loaded company is A and the loop collection "My Company" has ob jects as A, B and C. The collection is constructed as follows: [Collection : Led Cmp Coll] Collection : My Led : My Company [Collection : My Led] Type : Ledger Fetch : $Name, $Closing Balance [Collection : My Company]Objects in collection Grp Cmp Coll Objects in collection Stk-Coll Objects in collection Grp Cmp SSLoop Col-lection Objects in collection Grp Cmp SSRepeat-Coll 3-A, B, C All stock items of First member company i. e. A All stock items of all member companies Sum of Closing balance is evaluated by grouping Stock Item name and Unit Of Measure Item 1-500 Item 2-500Item 3-500 Item 1-500 Item 2-500Item 3-500Item 1-400Item 3-800Item 1-300Item 2-700Item 3-500 Item 1-1200 Nos Item 2 - 500 Kg Item 2 - 700 Nos Item 3 - 1800 Nos
TDL_Reference_Manual.pdf
What's New in Release 1. 6 656 Type : Company When the multi column report is displayed for the first time, a ll the ledgers are associated to the current company A forcefully, and their closing balance is displayed in the column as follow s: When an additional column is added for company B, the report is displayed as follows: For this column, the collection is gathered with the current co mpany B in context. As a result, the closing balances of ledgers belonging to compa nies A and B are available and are displayed in their respective com pany columns. As the company C context is not available, the closing balances of ledgers L5 and L6 are not displayed at all. When the column for company C is added, the closing balances of ledgers L1, L2, L3, L4, L5 and L6 are displayed in the respective company columns as follows:Ledger Name A Closing Balance L1 100 L2 200L3 300 L4 400 L5 500L6 600 Ledger Name A Closing Balance B Closing Balance L1 100 L2 200 L3 300 L4 400 L5 L6 Ledger Name A Closing Balance B Closing Balance C Closing Balance L1 100 L2 200L3 300 L4 400
TDL_Reference_Manual.pdf
What's New in Release 1. 6 65 7 Points for consideration during usage The collection attribute 'Search Key' can be specified only in the Summary Collection and not in the Data/Loop/Source Collection The Summary Collection using source collection created using lo op collection concept, can only be referred from elsewhere using the function $$Collection Field By Key. The other functions like $$Collection Field, $$Coll Amt T otal are at present not supported. If the companies have different currencies and aggregation is d one, then the resultant val- ues for the masters would not be displayed. In case the stock items of the companies have different units o f measures, and aggregation is done on them, the stock item name having different UOM would not be displayed at all in the list. 2. 3 Changes pertaining to Parameter Collection The internal collection "Parameter Collection" was used earlier in TDL at two places: When objects in the specified scope needed to be referred from a Report or Child Report. XML Data response, after triggering the action HTTP Post, which is used either in Success/ Error Report displayed for the user. As the 'Data Source' attribute of the Collection has been enhan ced to populate it using the objects in the specified scope from a current or Parent Report, the con cept of Parameter Collection in this respect does not carry relevance any more. We need to use Data Source capability, instead of Parameter Collection in codes to be written in future. For the existing TDLs which are already using Parameter Collect ion, a collection has been introduced in Default TDL, which uses Data Source with scope as selected. The TDLs which are using Parameter Collection for different scopes need to make desired changes in the code. In context of HTTP Post, the usage remains as it is. 3 User Defined Functions Enhancements The user-defined function can use a newly introduce looping con struct which iterates for the given range of values, and the action New Object has been enhanced to accept a logical value. 3. 1 New Looping Construct-FOR RANGE As explained earlier, TDL allows different looping constructs for varied usage. The existing loop constructs allow us to loop on the objects in collection or on the tokenized string or condition based looping of a set of statement. There are scenarios where the looping is to be performed for a range of values. For this, a new loop FOR RANGE has been introduced. The newly introduced loop c onstruct allows to loop on a range of numbers or date. This loop can be used to repeat a loo p for the given range of specified values. The range can either be incremental or decremental. The FOR RANGE loop can be used to get the Period Collection-like functionality. L5 500 L6 600
TDL_Reference_Manual.pdf
What's New in Release 1. 6 658 Syntax FOR RANGE : <Iterator Var> : <Data type> : <Start Range Expr> : + <End Range Expr> [:<Increment Expr>[:<Date Range Keyword>]] Where, <Iterator Var Name> is the name of the variable used for the iteration. This variab le is created implicitly. <Data T ype> can be Number or Date only. <Start Range Expr> is an expression which evaluates to number or date values. It r efers to the starting value of the range. <End Range Expr> is an expression which evaluates to number or date values. It r efers to the end value of the range. <Increment Expr> is an expression which evaluates to a number by which the <Star t Range-Expr> value is incremented. It is optional, and the default value is 1. <Date Range Keyword> is optional, and only applicable if the data type is Date. The values can be any one of 'Day', 'Week', 'Month' and 'Y ear'. Example: | 01 : FOR RANGE : Iterator Var : Number : 2 : 10 : 2 02 : LIST ADD : Even No : ##Iterator Var 03 : END FOR | The values 2,4,6,8,10 are added in the List variable 'Even No', as the range of value is 2 to 10, and the value is incremented by 2 with each iteration. Example:The following code snippet is used to calculate the number of w eeks elapsed between System date and Current Date set in T ally. | 09 : FOR RANGE : Iterator Var : Date : ##SVCurrent Date : $$Machine Date : 1 : "Week"10 : LOG : ##Iterator Var 20 : INCREMENT : Cnt30 : END FOR50 : LOG : "No of weeks Back Dated : "+$$String : ##Cnt
TDL_Reference_Manual.pdf
What's New in Release 1. 6 65 9 60 : RETURN: ##Cnt | Assume that the range for this is from 15-Mar-2009 to 30-Mar-2009. The values 15-Mar-20 09, 22-Mar-2009 and 29-Mar-2 009 are logged, as the increment is done by a 'Week'. So, there are three iterations of the loop. The number of weeks is logged using the counter. Example: | 09 : FOR RANGE : Iterator Var : Date : ##SVFrom Date:##SVTo Date : 1 : "Month" 10 : LOG : $$Month End : ##Iterator Var 20 : END FOR | Assume that the range for this is from 1-Jan-2009 to 5-Mar-2009. The values 31-Jan-2009, 28-Feb-2009 and 31-Mar-2009 are logged. 3. 2 New Function-$$Loop Index The TDL programming community is now aware about the enhancemen ts that have been introduced in TDL language and are efficiently implementing the same in the programs. A vast area of possible extensions is unlocked by the User Defi ned Functions in TDL. User defined functions gave the sequential control in the hands of t he TDL programmers. Many actions and looping constructs have been introduced in User Defined Fun ctions in TDL. During the sequential execution, the loops are used to iterate through a s et of values. TDL allows nested loops as well. There are scenarios where the loop counter is required for some evaluation. Presently, a variable is defined and then at the end of loop, its value is incremente d. This variable can be used for some calculations, if required. T o avoid this inline declaratio n of variable which is solely used as a counter, a new function $$Loop Index has been introduced. The function $$Loop Index gives the count of how many times the current loop is executed. In case of nested loops, the additional parameter <outer loop inde x number> can be used in the inner loop to get the current iteration count of the outer loop. Syntax $$Loop Index [:<Outer Loop Index Expr>] Where, <Outer Loop Index Expr> can be any expression which evaluates to a number. It is optional, and the outer loop index number in the nested loop hierarchy from t he inner most loop to the outer most loop. For the current loop, the value is 0 by default, for the parent loop 1, and so on. Consider following example: [Function : Loop Index Test] |
TDL_Reference_Manual.pdf
What's New in Release 1. 6 660 | 05 :WALK COLLECTION :......... | WHILE :....... | | FOR :.......... SET : Var: $$Loop Index LOG : ##Var | END FOR SET : Var1: $$Loop Index:1 | END WHILE| | END WALK The variable Var will hold the count of number of times the FOR loop is executed, while the variable V ar1 will have the count of 'WALK Collection' loop exe cution. 3. 3 Enhanced Action-NEW OBJECT The action 'New Object' takes two parameters Object T ype and Object Identifier. The syntax is: Syntax NEW OBJECT : <Object Type> : [:<Object Identifier>] Where, <Object T ype> is the type of the object to be created, <Object Identifier> is the unique identifier of the object. This parameter is optio nal. In case this is not specified, it creates a blank object of the specified type. The actions Save T arget/Alter T arget/Create T arget are used alo ng with New Object for specific usage. There are three scenarios to consider for this: 1. In case a Blank Object is created using 'New Object' without specifying the Object Identifier, the actions 'Save T arget' and 'Create T arget' will work, while 'Alter T arget' would fail. 2. In case an existing object is brought into context by specify ing Object Identifier with 'New Object', the actions 'Save T arget' and 'Alter T arget' will work, while 'Create T arget' would fail.
TDL_Reference_Manual.pdf
What's New in Release 1. 6 66 1 3. When an Object Identifier is specified with 'New Object' and the object does not exist in the database, the Action 'Save T arget ' fails, as 'New Object' does not create a blank object. In order to overcome the scenario (3), the Action 'New Object' has been enhanced to accept an additional parameter 'Force Create Flag' along with the Object Identifier. This forces the creation of an empty blank object, in case the Object with Identifier do es not exist in the database. Syntax NEW OBJECT : <Object Type> : [:<Object Identifier>[:<Forced Create Flag>]] Where, <Object T ype> is the type of the object to be created, <Object Identifier> is the unique identifier of the object. <Forced Create Flag> is an Optional Flag and is required only if <Object Identifier> is specified. If the Flag is set to TRUE, then if the object identified by <Obje ct Identifier> exists, the object is altered; otherwise, a new empty object of the specified type is created. Example: | 01: NEW OBJECT : Group: ##EGroup Name : TRUE 02: SET VALUE: Name: ##NGroup Name 03: SAVE TARGET | If the ledger identified by '##EGroup Name' exists in T ally database, then the objects are altered by the action SA VE T ARGET ; else, a new object is created as the Fo rced flag is set to 'YES'. 4 New Functions A new function $$Sys Info has been introduced to get any system-related information. 4. 1 Function-$$Sys Info The TDL Platform has provided TDL Programmers with various func tions that accept zero or more parameters, process them and return the appropriate result. Apart from the Object/ Data Manipulation, there is much syst em-related information that is required to be retrieved. Functions like $$Machine Date, which returns the System Date, $$Machine Time, which returns the System time, etc., are now supported by platform. Few more system related functions like Machine Name, Windows User Name, IP Address, etc., are required by the TDL Programmers. Save T arget' saves the current Object, wh ether it is a blank new Object, or an existing Object for Alteration.
TDL_Reference_Manual.pdf
What's New in Release 1. 6 662 Such system-related information is bundled together into a sing le function $$Sys Info, designed to accept different parameters based on requirement, and subsequen tly return the desired result. Syntax $$Sys Info : <Parameter> Where, <Parameter> can be any one of Application Path, Current Path, System Date, Syt em Time, System Time HMS, System Name, Is Windows, Windows Version, Windows Us er, IP Address, MACAd-dress. Example: $$Sys Info : Machine Name This will return the Machine Name, in which current copy of T al ly is running. Example of each parameter has been explained considering the fo llowing system details: Application Path is C:\T ally. ERP9 Data Path is C:\T ally. ERP9\Data System Date is 27-Sep-2009 System Time is 18:27 System Time in Hours, Minutes and Seconds is 18:27:36 System Name is T ally System1 Operating System is Windows 7 / Windows XP / Windows 2000 / Windows Vista Version of Windows is 5. 1 (2600) User logged into Windows is T ally. User1 Network IP Address is 192. 168. 1. 17 Network Adapter's MAC Address is 0720fhac027a List of Parameters with corresponding Result Application Path-Returns the Folder path, from where the current copy of T ally is executed. Example: $$Sys Info : Application Path returns C:\Tally. ERP9 Current Path-Returns the Data path configured in T ally. INI residing within the application path. Example: $$Sys Info : Current Path returns C:\Tally. ERP9\Data System Date-Returns the current System/ Machine Date. Example: $$Sys Info : System Date returns 27-Sep-2009
TDL_Reference_Manual.pdf
What's New in Release 1. 6 66 3 System Time-Returns the current System/ Machine Time. Example: $$Sys Info : System Time returns 18:27 System Time HMS-Returns the current System/ Machine Time in Hour Minute Secon d Format. Example: $$Sys Info : System Time HMS returns 18:27:36 System Name-Returns the current System/ Machine Name. Example: $$Sys Info : System Name returns Tally System1 Is Windows-Returns YES only if the current Operating System is Windows, else returns NO. Example: $$Sys Info : Is Windows returns Yes Windows Version-Returns the current Windows Version with the Build Number. Example: $$Sys Info : Windows Version returns 5. 1 (260 0) Windows User-Returns the Name of the User who has logged into the current Windows session. Example: $$Sys Info : Windows User returns Tally. User1 IP Address-Returns the Network IP Address of the current system. Example: $$Sys Info : IPAddress returns 192. 168. 1. 17 MACAddress-Returns the Network Adapter's Media Access Control Address of the current system. Example: $$Sys Info : MACAddress-072 0fhac027a Corresponding Functions Application Path, Current Path, Machine Date, Machine Time, Is Windows, Windows Version, Windows User, IP Address and MACAddress are alternative functions available in default TDL. These functions are deprecated from platform.
TDL_Reference_Manual.pdf
TDL_Reference_Manual.pdf
665 What's New in Release 1. 52 In this release, major enhancements have taken place at the Col lection level and in the User Defined Functions. Further sections talk in depth about the usa ge of Data Source attribute in Collection and the various Looping Constructs inside a Function. Few generic built-in functions-$$Access Obj, $$First Obj and $$Last Obj have been introduced. Https client capability has been enhanced in T ally to exchange data with other applications securely. Https sites can be used for ftp upload, posting request and re ceiving data in collection. 1. Collection Enhancements-Attribute 'Data Source' enhanced The TDL programmers are aware that data from various data sourc es can be gathered in a collection. Till the release 1. 5, the data sources were T ally database, XML, HTTP, ODBC and DLL. After the multi-line selection capability was introduced, a report or a function could be launched from the current report based on the specified scope. The different scopes that could be specified were Selected lines, Current line, Unselected lines, etc. Now, the objects can also be gathered from the report or parent rep ort using the T ype parameter for the Collection attribute Data Source. This new capability allows the access of specific objects of a report from anywhere; like Functions, Subsequent report or the Current report itself. The Data Source attribute of the collection has been enhanced to support these two data sources, in addition to the existing data sources. The collection can be cr eated directly from the specified data source and can be displayed in a report. Syntax Data Source : <Type> : <Identity> [:<Encoding>] Where, <T ype> specifies the type of data source, e. g., File Xml, HTTP XML, Report, Parent Report. <Identity> can be the file path or the scope keywords. If the type is File XML or HTTP XML, <identity> is the data source file path. If the type is Report or Parent Report then the scope keywords ' Selected Lines ', 'Un Selected Lines ', 'Current Line ', 'All Lines ', 'Line' and ' Sorting Methods ' are used as identity. <Encoding> can be ASCII or UNICODE. It is Optional. The default value is U NICODE. If the data source type is Report or Parent report, the encoding format is ignored. 1. 1 Existing Data Source T ypes Example: XML file as data source [Collection : My XML Coll] Data Source : File XML : “C:\My File. xml” In this code snippet, the type of file is 'File XML', as the data source is XML file. The encoding is Unicode by default, as it is not specified.
TDL_Reference_Manual.pdf
What's New in Release 1. 52 666 Example: HTTP as data source [Collection : My XML Coll] Data Source : HTTP XML : “http:\\localhost \My File. xml” : ASCII In this code snippet, the type of file is ' HTTP XML ', as the data source is obtained through HTTP. The encoding of the file ' My File. XML ' is ASCII. While specifying the URL, now the https site can be given in Collection attributes Remote URL and Data Source. 1. 2 Data Source T ypes Introduced Example: Report as data source [Collection : My Report Coll] Data Source : Report : Selected Lines The selected objects from the current report in which the colle ction is accessed, is the data source for the collection ' MY Report Coll '. Example: Parent Report as data source [Collection : My Parent Rep Coll2] Data Source : Parent Report : Un Selected Lines The objects associated with all the unselected lines from the p arent report are gathered for the collection ' My Parent Rep Coll2 '. The objects of the report with the given scope can be accessed from the report and functions which are called from the report. 2. Enhancements in User Defined Functions In this release, 'Dynamic action support' has been provided for simple actions inside a function and the looping construct Walk Collection has been enhanced. New looping constructs FOR COLLECTION and FOR TOKEN have been introduced as well. There are scenarios when the collection name is to be obtained from an expression while performing a Walk. WALK COLLECTION has been enhanced to provide this functionality. FOR COLLECTION loop has been introduced to walk the collection for a specific value. FOR TOKEN loop walks on the tokens within a string separated by a specifi ed character. 2. 1 Attribute 'Walk Collection' Enhanced The 'Walk Collection' attribute has been enhanced to accept Col lection Name as an expression and an additional logical parameter. For example, now the collection name can be passed as parameter to the function while executing it. Syntax Walk Collection : <Expression> [:<Rev Flag>]
TDL_Reference_Manual.pdf
What's New in Release 1. 52 66 7 Where, <Expression> can be any expression which evaluates to a collection name. <Rev Flag> can be any expression which evaluates to a logical value. If it is True, then the collection objects are traversed in reverse order. This parameter is optional. The Default value is False. Example: [Function : Test Function] Parameter : parmcoll | | 05 : WALK COLLECTION : ##parm Coll : Yes The collection name is passed as parameter to the function ' T est function ' and is walked in reverse order. The code snippet to call the function ' T est function ' from a key is as follows: [Key : DC Call Function] Key : Enter Action : CALL : Test Function : ##Coll Name The collection name is passed through the variable 'Coll Name'. 2. 2 Dynamic Actions Prior to Release 1. 52, the dynamic action capability was availa ble for global actions. It was possible to specify the Action Keyword and Action parameters as expressions. This allowed the programmer to execute actions based on dynamic evaluation of pa rameters. The 'Action' keyword can as well be evaluated dynamically. The dynamic action capability is now introduced for simple acti ons inside a function. Expressions can be used to evaluate the name of the Action as well as Actio n parameters. The new action with Action keyword has been introduced to achieve this. Syntax Action : <Expression> : <Action Parameters> Where, <Expression> is any expression evaluating to a simple action name like LOG, DISPLAY, etc. <Action Parameters> are parameters required by the action passed through an express ion. Example: [Function : Obj Func] |
TDL_Reference_Manual.pdf
What's New in Release 1. 52 668 | 02 : ACTION : LOG : "$" + ##p Obj Method Inside a function, a global actio n can be called using dynamic action capability. In this case, the expression specified in the dynam ic action is evaluated in the context of the function, and then the global action is executed. The context of function elements like V ariables, Objects, etc., can be used while calling a global action dynamically. For example, the variable name or methods of an object can be passed as parameter while executing the dynamic action. Example: [Function : Dynamic Action Within Function] Variable : DA Logical : Logical | | 40 : SET: DA Logical : Yes 50 : ACTION : Display : if ##DALogical then "Trial Balance" else + "Balance Sheet" In function ' Dynamic Action Within Function ', first the expression is evaluated and then based on the value, the report ' T rial Balance ' is displayed. 2. 3 Looping Constructs 'For Co llection' and 'For T oken' introd uced Two new looping constructs-For Collection and For T oken have been introduced in user defined functions. Looping Construct-FOR COLLECTION When WALK COLLECTION is used inside a function, the object of c ollection is set as the current object in the context of iteration, i. e., the loop is executed for each object in the collection, making it as the current context. The newly introduced FOR COLLECTION provides a context free wal k, as the current object is not set as the current object context while looping. It loops o n the collection for the specific value and returns the value in the iterator variable. The value of th e iterator variable can be referred to by the actions inside the For Collection loop. Syntax FOR COLLECTION : <Iterator Var> : <Coll Exprn> [:<Value Exprn : <Rev Flag>] Where, <Iterator Var> is the name of the variable which is used for the iteration. This variable is created implicitly. <Coll Exprn> can be any expression which evaluates to a collection name.
TDL_Reference_Manual.pdf
What's New in Release 1. 52 66 9 <Value Exprn> can be any expression, whose value is returned in the iterator variable. If the value expression is not specifi ed, the name of the object is re turned. <Rev Flag> can be any expression which evaluates to a logical value. If it is True, then the collection objects are traversed in reverse order. This parameter is optional. The Default value is False. Example: [Function : Test Function] | | 30 : FOR COLLECTION : i : Group : $Closing Balance > 1 000 40 : LOG : ##i 50 : END FOR The value Yes is logged in the file 'TDLFunc. lo g' if the closing balance is g reater than 1 000, else No. Looping Construct-FOR TOKEN The looping construct FOR TOKEN is used to walk a String expres sion separated by a delimiter character. It loops on a String expression and returns one value at a tim e. The value is returned in the iterator variable. Syntax FOR TOKEN : <Iterator Var> : <Src String Exprn> [:<Delimiter Char>] Where, <Iterator Var Name> is the name of the variable used for iteration. The variable is created implicitly. <Src String Exprn> can be any string expression separated by a <delimiter Char >. <Delimiter Char> can be any expression which evaluates to a character used for s eparating the string expression. It is optional. The default separator char i s ':'. Example: [Function : Test Function] | | 01 : FOR TOKEN : Token Var : "Tally : Shopper : Tally Developer" : ":" 02 : LOG : ##Token Var 03 : END FOR This code snippet will give the output as shown below:
TDL_Reference_Manual.pdf
What's New in Release 1. 52 670 Ta l l y Shopper Ta l l y D e v e l o p e r 3. New Functions New functions $$Access Obj, $$First Obj and $$Last Obj have been i ntroduced in this release. 3. 1 Function-$$Access Obj The capability to access data objects associated with Interface objects was introduced in T ally. ERP 9. The attribute 'Access Name' is used to specify nam e to 'Part' or 'Line' Definition. This name can be used to refer to the Data Object associated with th e Part or the Line. A new function $$Access Obj has been introduced to evaluate the specified formula in the context of the Interface object identified by the given definition type and access name. Syntax $$Access Obj : <Definition Type> : <Access Name Formula> : <Evaluation Formula> Where, <Definition T ype> can be Part or Line. <Access Name Formula> can be any formula which evaluates to a string. <Evaluation Formula> is a formula which is evaluated in the context of the object id entified by the definition type and the access name. Example: [Line : Access Obj] Fields : Access Obj Access Name : "AO1" On : Focus : Yes : CALL : Access Obj [Field : Access Obj] Set As : $Name [Function : Access Obj] Variable : Access Obj : String 00 : SET : Access Obj : $$Access Obj : Line : "AO1" : $Name 10 : LOG : ##Access Obj The same List is considered in explaining the further examples.
TDL_Reference_Manual.pdf
What's New in Release 1. 52 67 1 The Line 'Access Obj' is identified by the access name 'AO1'. Th e access name is used while evaluating the value of $Name. 3. 2 Functions-$$First Obj and $$Last Obj The objects of the collection are available in the context of r epeat line or while performing a walk inside a function. The functions $$First Obj and $$Last Obj can b e used to find the first or the last object of the collection respectively. Function-$$First Obj The function $$First Obj returns the value of the specified method for the first object of the collection. Syntax $$First Obj : <Method Name> Where, <Method Name> is the name of a method of the current object in context. Example: 40 : LOG : "First Object : " + $$First Obj : $Name $$First Obj logs the name of the first object of the collection, which is u sed in Walk Collection. Function-$$Last Obj The function $$Last Obj returns the value of the specified method for the last object o f the collection. Syntax $$Last Obj : <Method Name> Where, <Method Name> is the name of a method of the current object in context. Example: 50 : LOG : "Last Object: " + $$Last Obj : $Name The function $$Last Obj logs the name of the last object of the collection, which is us ed in Walk Collection. 4. https URL support in T ally Https client capability has been enhanced in T ally to exchange data with other applications securely. Https sites can be used for ftp upload, post request and receiv ing the data in collection. Now, data can be uploaded to https site, or request to the https site can be sent, using the action HTTP Post. The URL for the https site can be specified while gathering dat a in a collection. Example: Upload In the upload configuration screen, the URL for https site can be given as shown:
TDL_Reference_Manual.pdf
What's New in Release 1. 52 672 Figure 1. Upload Configuration Screen Example: Action HTTP Post [Button : Post Button] Key : Ctrl+K Action : HTTP Post : @@My URL : ASCII : HTTP Post Req Rep : + HTTP Post Response Report1 : HTTP Post Response Report [System : Formula] My URL : “https//www. testserver. co. in/CXMLResponse as per tally. php" Example: In collection [Collection : https Coll] Remote URL : “https//www. testserver. co. in/Test XML. xml”
TDL_Reference_Manual.pdf
673 What's New in Release 1. 5 1. Collection Enhancements TDL supports the hierarchical database structure. While designi ng any report, the objects are first populated in the collection, before being displayed. TDL also supports the concept of aggregate/summary collection, for creating summarized reports. In the aggregate collection, during evaluation, the following t hree sets of objects are available: Source Objects: Objects of the collection specified in the Source Collection attribute. Current Objects: Objects of the collection till which the Walk is mentioned. Aggregate Objects: Objects obtained after performing the Grouping and Aggregation. There are scenarios where some calculation is to be evaluated b ased on the source object or the current object value, and the filtration is done based on the v alue evaluated with respect to final objects before populating the collection. In these cases, to ev aluate value based on the changing object context is tiresome, and sometimes impossible as well. The newly introduced concept of collection level variables prov ides Object-Context Free processing. The values of these in-line variables are evaluated before populating the collection. The sequence of evaluation of the collection attributes is changed to support the attributes 'Compute V ar', 'Source V ar' and 'Filter V ar'. The variables defined usin g attributes 'Source V ar' and 'Compute V ar' can be referred in the collection attributes By, Aggr Compute and Compute. The variable defined by Filter Var can be referred in the collection attribute Filter. The values of these variables can be accessed from anywhere whi le evaluating the current collection objects. Sometimes, it is not possible to get the value of the object f rom the current object context. In such scenarios, these variables are used. 1. 1 Collection Attributes-Source Var, Compute Var, Filter Var Attribute-Source Var The attribute Source Var evaluates the value of the vari able based on the source object. Syntax Source Var : <Variable Name> : <Data Type> : <Formula> Where, <Variable Name> is the name of the variable. <Data T ype> is the data type of the variable. <Formula> can be any expression formula, which evaluates to a value of 'V ariable' data type. Example: Source Var : Log Var : Logical : No
TDL_Reference_Manual.pdf
What's New in Release 1. 5 674 The value of the variable Log Var is set to NO. Attribute-Compute Var The attribute Compute Var evaluates the value of the variable based on the sub-object of the source object. Syntax Compute Var : <Variable Name> : <Data Type> : <Formula> Where, <Variable Name> is the name of the variable. <Data T ype> is the data type of the variable. <Formula> can be any expression formula which evaluates to a value of 'V a riable' data type. Example: Compute Var : IName:String : if ##Log Var then $Stock Item Name else ##Log Var Attribute-Filter Var The attribute Filter Var evaluates the value of the variable based on the objects availa ble in the collection, after the evaluation of attributes Fetch and Compute. Syntax Filter Var : My Fil Var : <Data Type> : <Formula> Where, <Variable Name> is the name of the variable. <Data T ype> is the data type of the variable. <Formula> can be any expression formula which evaluates to a value of the 'V ariable' data type. Example: Filter Var : Fin Obj Var : Logical : $$Number:$Billed Qty > 100 1. 2 Sequence of Evaluation of Collection Attributes The collection attributes are evaluated as per the following se quence, before populating the collection: 1. Source Collection 2. Source V ar 3. Walk 4. Compute V ar5. By 6. Aggr Compute 7. Compute8. Filter V ar 9. Filter With the introduction of these attributes, the calls to the fun ctions $$Owner, $$Req Object, $$Filter V alue, $$Filter Amt T otal, etc., can be reduced.
TDL_Reference_Manual.pdf
What's New in Release 1. 5 67 5 1. 3 Usage of the Collection at tributes-Source Var, Compute V ar, Filter Var In this section, the use cases where the collection attributes can be used, are explained. Usage of 'Compute Var' in Simple Collection When Compute Var is used in a simple collection, then before populating the obje cts in the collection, Compute var is evaluated. Consider the following Collection Definition: [Collection : Test Com Var] Type : Group Compute Var : Cmp Var Coll : String : $Name Compute : My Amt : $$Collamt Total : Test Com Var Sub : $Opening Balance [Collection : Test Com Var Sub] Type : Ledger Child Of : ##Cmp Var Coll Fetch : Name, Opening Balance The sequence of evaluation is as follows: 1. T ype attribute is evaluated, and the objects of the specified type a re identified. 2. Compute Var is evaluated and the name of the first object, i. e., the Group name is set as a value of the variable 'Cmp V ar Coll'. 3. For this selected group, the method $My Amt is evaluated. This gives the total amount of all the ledgers belonging to the group in the variable 'Cmp V ar Coll'. 4. Steps 2 and 3 are repeated for each group in the collection ' Te s t C o m Va r '. 5. After computing the value of the method $My Amt for each group, the collection is populated with the objects. The variable 'Cmp V ar Coll' can also be referred in the By, Aggr Compute and Filter attributes of the collection. Usage of Source Var, Compute Var and Filter Var in Aggregate collection When these collection attributes are used along with other attr ibutes, the sequence of evaluation is as mentioned earlier. Let us try to understand this with the following 'Collection' definition: [Collection : CFBK Voucher] Type : Voucher Filter : Is Sales VTCompute Var : Src Var : Logical : $$Is Sales : $Voucher Type Name [Collection : Smp Stock Item] Source Collection : CFBK Voucher
TDL_Reference_Manual.pdf
What's New in Release 1. 5 676 Source Var : Str Var: String : $Voucher Number "/" $Voucher Type Name Walk : Inventory Entries Compute Var : IName: String : if ##Str Var CONTAINS "12" then+ $Stock Item Name else $Stock Item Name + "-" + $$String : ##Str Var By : IName: ##IName Aggr Compute : Billed Qty: SUM: $Billed Qty Filter Var : Fin Obj Var : Logical : $$Number : $Billed Qty > 100 Filter : Final Filter [System : Formula] Is Sales VT : ##Src Var Final Filter : ##Fin Obj Var The evaluation process is as follows: 1. V alue of the variable Src Var is evaluated, and referred in the Filter attribute of the collection 'CFBK Voucher'. 2. In the collection 'Smp Stock Item', the value of the variable Str Var is evaluated on the first object of source collection 'CFBK Voucher'. 3. Then, 'Walk' is performed and the Inventory Entry objects are collected. 4. The value of the variable IName is evaluated. If Source V ariable Src Var contains "12”, then the variable IName stores only the Stock Item Name method, else it stores Stock Item Name + value of the variable Str Var. 5. The grouping is done on the resultant value of IName variable. 6. The value of the method $Billed Qty is computed. 7. The variable Fin Obj Var retains a logical value, if the method $Billed Qty is greater than 100. 8. Based on the value of Fin Obj Var, filtering is done. 9. Finally, the collection is populated with the filtered objects. 2. List Variables Introduced The TDL programmer community is aware of the functionality of v ariables, and their usage as context-free structures in TDL. Till this release, two types of variables were supported-'Simple' and 'Repeat'. The following scope can be defined for variables: Report Level-commonly referred to as Local Variables. System Level-commonly referred to as Global variables. Function Level-Local variables used inside User-defined funct ions. The variable framework has been enhanced to support a new type of variable called 'List V ariable', which allows us to perform complex calculations on d ata available from multiple objects.
TDL_Reference_Manual.pdf
What's New in Release 1. 5 67 7 2. 1 List Variable List variable can store multiple values of single data type in the key: value format. Every single value in the List variable is uniquely identified by a 'key'. T he 'Key' is of type String by default, and is maintained internally. List Var is an alias of the attribute List Variable. Syntax List Variable : <Variable Name> [ : <Data Type>] Where, <Variable Name> is the name of the variable. <Data T ype> is the data type of the variable. It is Optional. If it is spec ified, a separate V ariable definition is not required. If not specified, a variable definition with same name must be specified. Example: [Function : Test Function] List Variable : List Var : String The variable List Var can hold multiple string values. Example: [Report : Test Report] List Variable : List Var Rep : String The variable List Var Rep can hold multiple strings in the 'Report' scope. The List variable provides a set of actions and internal functi ons for data manipulation, which will be explained in the following section. List Variable Manipulation List variable supports various data manipulation operations, wh ich include: 1. Adding/Deleting V alues-Actions List Add and List Delete 2. Populating List V ar from a Collection-Action List Fill 3. Accessing List V ariable values-Function $$List Value 4. Sorting the values in the List V ariable Adding/Deleting values in a List Variable The actions used to add/delete values in the list variable are LIST ADD and LIST DELETE. Action-LIST ADD The action LIST ADD is used to add the values in a List variable. It adds a single value at a time to the list variable, identified by a key. If the value is added to the list with duplicate key, then the existing value is overwritten. LIST SET is an alias for the action LIST ADD. Syntax LIST ADD : <List Var Name> : <Key Formula> : <Value Formula>
TDL_Reference_Manual.pdf
What's New in Release 1. 5 678 Where, <List Var Name> is the name of the list variable. <Key Formula> can be any expression formula which evaluates to a unique strin g value. <Value Formula> can be any expression formula which returns a value. The data type of the value must be same as that of the List variable. Example: LIST ADD : Test Func Var : "Mobile" : 9340193401 LIST ADD : Test Func Var : "Office" : 08066282559 LIST ADD : Test Func Var : "Fax" : 08041508775 LIST ADD : Test Func Var : "Residence" : 08026662666 The four values inserted in the list variable 'T est Func Var ' are identified by the key values 'Mobile', 'Office', 'Fax' and 'Residence' respectively. T o add multiple values dynamically in the list variable, loopin g constructs WHILE, WALK COLLECTION, etc., can be used. LIST REMOVE is an alias for LIST DELETE. Action-LIST DELETE The action LIST DELETE is used to delete values from the List variable. It allows to delete a single value at a time or all the values in one go. Syntax LIST DELETE : <List Var Name> [:<Key Formula>] Where, <List Var Name> is the name of the list variable. <Key Formula> can be any expression formula which evaluates to a unique strin g value. In the absence of key formula, all the values in the list will be dele ted. In other words, if key formula is omitted, the list is reset. Example: 1 LIST DELETE : Test Func Var : "Office" The value identified by the key 'Office' is deleted from the li st variable 'T est Func V ar'. Example: 2 LIST DELETE : Test Func Var The same List is considered in explaining the further examples.
TDL_Reference_Manual.pdf
What's New in Release 1. 5 67 9 All the values in the list variable T est Func Var are removed. The list variable is empty after the execution of the action. Populating List variable from a collection Instead of using looping constructs, multiple values from a collection can be added to the list variable using one statement. Action LIST FILL is used for the same. Action-LIST FILL It is used to add multiple values from a collection to the List V ariable. Syntax LIST FILL : <List Var Name> : <Collection Name : <Key Formula> : <Value Formula> Where, <List Var Name> is the name of the list variable. <Collection Name> is the name of collection from which values are fetched to fill the list variable. <Key Formula> can be any expression formula which evaluates to a string value. <Value Formula> can be any expression formula which returns a value. The data type of the value must be the same as that of the List variable. The action LIST FILL returns the number of items added to the l ist variable. Example: LIST FILL : Test Func Var : Group : $Name : $Name Accessing List variable values T o access values from a list variable, a function is to be used. TDL provides different functions to fetch the value from a list variable, identified by the given key. Function-$$List Value $$List V alue returns the value identified by the given key in th e list variable. Syntax $$List Value : <List Var Name> : <Key Formula> Where, <List Var Name> is the name of the list variable. <Key Formula> can be any expression formula which evaluates to a string value. Example: $$List Value : Test Func Var : "Mobile" In this example, the function retu rns the values identified by the key 'Mobile' from the list variable 'T est Func V ar', when the function is executed. Sorting values in a List variable By default, the values in the list variable are sorted in the o rder of entry. TDL provides the facility to sort the values in the list variable either by key or by val ue. The data type can be specified while
TDL_Reference_Manual.pdf
What's New in Release 1. 5 680 sorting based on key. Following actions allow to change the sort order: List Key Sort List V alue Sort List Reset Sort These actions accept three parameters. First parameter is the name of the List variable, followed by the Sorting flag and a key data type. In the absence of <key data type>, natural sorting method is used. In natural sorting method, the key data type is identified as one of the data types Date, Number OR String. Date data type accepts any valid date format. If it is not of 'Date' data type and starts with a number or a decimal, then it is assumed as Number. If it is neither 'Date' nor 'Number', then it is considered as String. Different data types are compared in the following order as Nu mber, Date and String. Action-LIST KEY SORT This action allows sorting the list based on key value. If the data type specified while sorting the list is different than the original, then this action will temp orarily convert the original data type to the specified data type while comparing the elements for sortin g the list and the list will be sorted based on the new data type specified. The original list and the key data type remains as it is, on which a new sorting can be applied, based on some other data ty pe, at any other point of time. LIST SORT is an alias of the action LIST KEY SORT. Syntax LIST KEY SORT : <List Var Name> [:<Asc/Desc flag> : <Key Data Type>] Where, <List Var Name> is the name of the list variable. <Asc/Desc> can be YES/NO. YES is used to sort the list in ascending order and NO for descending. If the flag is not specified, then the default order is ascending. <Key Data T ype> can be String, Number, etc. It is optional. Example: 1 LIST KEY SORT : Test Func Var : YES : String The values in the list variable are sorted in ascending order o f the key. Example: 2In case a different data type is used for sorting, the key may become duplicate if the conversion fails as per the data type specified for sorting. If the key be comes duplicate, then the insertion order of the items in the list variable is used for comparison. LIST KEY SORT : Test Func Var : YES : Number In this example, the action LIST KEY SORT will convert the key to ZERO (0) for all the list items while comparing, as all the keys are of type String. In this case, the insertion order will be considered for sorting. As a result, the values in the list wil l be sorted in the following order: 9340193401, 08066282559, 080415 08775, and 08026662666.
TDL_Reference_Manual.pdf
What's New in Release 1. 5 68 1 In case the key contains numeric values like "1 1", "30", "35" a nd "20", which can be converted to Number, the list is sorted based on the key values, else it converts t hem to ZERO and sorts the list as per the order of insertion. Action-LIST V ALUE SORT Action LIST V ALUES SORT sorts the list items based on value. As there can be duplicate values in the list, the combination of key and value is considered as key for sorting duplicate values. Syntax LIST VALUESORT : <List Var Name> [:<Asc/Desc flag> : <Key Data Type>] Where, <List Var Name> is the name of the list variable. <Asc/Desc> can be YES/NO. YES is used sort the list in ascending order and NO for descending. It is optional. If the flag is not specified, then the default order is ascending. <Key Data T ype> can be String, Number, etc. It is optional. Example: LIST VALUE SORT : Test Func Var : YES : String The values in the list variable are sorted in ascending order o f values. Action-LIST RESET SORT The action LIST RESET SORT retains the sorting back to the order of insertion. Syntax LIST RESET SORT : <List Var Name> Where, <List Var Name> is the name of the list variable. Example: LIST RESET SORT : Test Func Var Here, the action resets the sort order of the list variable 'T e st Func V ar' to the order of insertion. 2. 2 Functions Used with List Variables TDL supports some functions for general operations like finding the total number of items in a list, checking whether the last action was successful, etc. Function-$$List Value As explained earlier in section 2. 1, this function is used to a ccess values from a list variable. Function-$$List Count The function $$List Count gives the total number of values available in the list variable. Syntax $$List Count : <List Var Name> Where, <List Var Name> is the name of the list variable.
TDL_Reference_Manual.pdf
What's New in Release 1. 5 682 Example: $$List Count : Test Func Var The action returns the number of items in the list variable 'T e st func V ar', when it is executed. Function-$$List Find The function List Find is used to search if the value belonging to a specific key is a vailable in the list variable. If the key is found, $$List Find returns TRUE, ot herwise it returns FALSE. Syntax $$List Find : <List Var Name> : <Key Formula> Where, <List Var Name> is the name of the list variable. <Key Formula> can be any expression formula, which evaluates to a string value. Example: $$List Find : Test Func Var : "Mobile" It returns TRUE if the key 'Mobile' is present in list variable 'T est func Var', else returns FALSE. 2. 3 Constructs introduced in Functions for List Var Looping Construct-FOR IN The FOR IN loop is supported to iterate the values in the list variable. The number of iterations depends on the number items in the list variable. Syntax FOR IN : <Iterator Var Name> : <List Var Name>.   .  END FOR Where, <Iterator Var Name> is the name of variable used for iteration. The variable is cre ated implicitly. <List Var Name> is the name of the list variable. Example: FOR IN : Cnt : Test Func Var LOG : $$String : $$List Value : Test Func Var : ##Cnt END FOR All the values of the list variable 'T est Func Var' are logged in the file 'tdlfunc. txt'. Function $$Last Result is used to check if the last executed action was successful. If the last action that was executed is LIST ADD or LIST DELETE, then the function returns TRUE if the action was successful, and F ALSE otherwise. If the last action that was executed is LIST FILL, then $$Last Result returns the number of items inserted in the list variable.
TDL_Reference_Manual.pdf
What's New in Release 1. 5 68 3 3. Dynamic Actions A new capability has been introduced with respect to Action fra mework, where it is possible to specify the Action keyword and Action parameters as expressions. This allows the programmer to execute actions based on dynamic evaluation of parameters. The 'Action' keyword can as well be evaluated dynamically. Normally, this would be useful for specifying condition-based action specification in menu, key / button, etc. In case of functions, as the function inher ently supports condition-based actions via IF-ELSE, etc., this would be useful when one required to write a generic function, which takes a parameter and later passes that to an action (as its parameter), which does not allow expressions and expects a constant. This h as been achieved with the introduction of a new keyword " Action ". 3. 1 'Action' Keyword The 'Action' keyword allows the programmer to execute actions b ased on dynamic evaluation of parameters. The syntax for specifying the same is as given belo w: Syntax Action : <Action Keyword Expression> : <Action Parameter Expression> Where, <Action> is the keyword Action to be used for Dynamic Actions usage. <Action Keyword Expression> is an expression evaluating to an Action Keyword. <Action Parameter Expression> is an expression evaluating to Action Parameters. We can specify and initiate an Action from the following: Menu Item Key Definition In a User Defined Function At present, the capability is valid for: Global Actions like Display, Alter, etc. Global Actions inside User Defined Functions Example: 1. Dynamic Actions in Key/Button Definition [Button : Test Button] Key : F6 Action : Action : Display : @@My For ;; The Button Test Button initiates a dynamic Action which takes the parameter as a formula. [System : Formula] My For : if ##SVCurrent Company CONTAINS "ABC" Then "Balance Sheet" + else "Trial Balance"
TDL_Reference_Manual.pdf
What's New in Release 1. 5 684 1. Dynamic Actions in User Defined Functions [Button : Test Button] Key : F6 Action : Call : Test Func : "Balance Sheet" [Function : Test Func] Parameter : Test Func : String 01 : Action : Display : ##Test Func ;;The function Test Func executes a dynamic action, which takes Ac tion parameter as the parameter passed to the function. 4. New Functions In this release, two new functions have been introduced-$$Tgt Object and $$Context Keyword. 4. 1 Function-$$Tgt Object In TDL, normally all evaluation is done in context of the Conte xt object. With the introduction of aggregate collections and user-defined functions, apart from th e Requestor Object context and Source Object context, now the T arget Object context is also available. The object which is being populated or altered is referred to a s the T arget object. In simple collections, the Source Object and the T arget Object are both t he same. In case of aggregate collections and user-defined functions, the T arget Object is different. There are scenarios where the expression needs to be evaluated in the context of the T arget object. In such cases, the function $$Tgt Object can be used. Function-$$Tgt Object The new Context Evaluation function $$Tgt Object evaluates the e xpression in the context of the T arget Object. Using $$Tgt Object, values can be fetched from th e target object without making the target object as the context object. Syntax $$Tgt Object : <String Expression> Where, <String Expression> is the expression which will be evaluated in the context of T ar get Object. Observe the usage of Action keyword twice in this example. The first usage is the attribute "Action" for 'Key' definition. The second is the keyword "Action" introduced specifically for executing Dynamic Actions.
TDL_Reference_Manual.pdf
What's New in Release 1. 5 68 5 Usage of $$Tgt Object in User Defined Functions In a user defined function, while setting the method values of target object, the expressi on needs to be evaluated in the context of the target object itself. $$Tgt Object is used in this case. Example: Ledgers 'Party 1' and 'Party 2' are having some opening balance. The requirement is to add the opening balances of both ledgers and set the resultant value as the opening balance of Party 2. [Function : Sample Function] Object : Ledger : "Party 1" : NEW OBJECT : Ledger : "Party 2" + : SET VALUE : Opening Balance : $Opening Balance + $$Tgt Object : $Opening Balance : ACCEPT ALTER ;; By prefixing $$Tgt Object to the opening balance, the cl osing balance of the T arget Object, i. e., Party 2, is retrieved. Here, 'Party 1' is the Source object and 'Party 2' is the T arge t object. The opening balance of 'Party 2' is accessed using the expression $$Tgt Object:$Opening Balance. Usage of $$Tgt Object in Collections In simple collections, the source object and the target object are both the same. In case of aggregate collections and user defined functions, the target ob ject is different. The function $$Tgt Object allows to access the values from the target object itself, whil e the collection is being populated. It is required in aggregate coll ection, where the source object is not the same as the target object. The function $$Tgt Object is useful when the values are to be po pulated in collection, based on the values that have been computed earlier. In aggregate collections, the function $$Tgt Object can be used in the attributes Fetch, Compute and Aggr Compute of collection. Example: A report is to be designed for displaying the stock item, the d ate on which the maximum quantity of the item is sold and the maximum amount is received. The coll ection is defined as follows: [Collection : Src Voucher] Type : Vouchers : Voucher Type Child Of : $$Vch Type Sales [Collection : Summ Voucher] Source Collection : Src Voucher Walk : Inventory Entries By : Item Name : $Stock Item Name Aggr Compute : Max Date : SUM : IF $$Is Empty : $$Tgt Object : $Item Det + OR $$Tgt Object : $Item Det < $Amount THEN $Date ELSE +
TDL_Reference_Manual.pdf
What's New in Release 1. 5 686 $$Tgt Object : $Max Date Aggr Compute : Item Det : MAX : $Amount While creating a collection “Summ Voucher”, $$Tgt Object is used to get the date on which the maximum sales amount is received for each stock item. $Item Det gives the maximum amount received for individual item. I n the condition checking part, if the evaluated $Item Det is empty for the stock item or is less than the current amount of the stock item of the source object, then the current date is selected, otherwise the value of $Max Date is retained. Following T able shows the evaluation of values with respect to the target object: 4. 2 Function-$$Context Keyword A new function $$Context Keyword can be used to get the title of the current Report or Menu. It is used to search the context-sensitive/online help based on the R eport or Menu title. Syntax $$Context Keyword [:Yes/No] The default value is NO. If the value is specified as YES, then the title of the parent report is returned. If no report is active, then the parameter is ignored. If the attribute Title is not specified in the Report definition, then by default, it returns the name of the Report. Example: [Report : Context Keyword Function] Form : Context Keyword Function Title : "New Function Context Keyword" | | [Field : Context Keyword Function] Source Object Current Objects Target Objects 3 Sales Voucher 8 Inventory Entries 3 Sales Voucher-1 Dated-7/7/09 Item 1-Rs. 500 Item 2-Rs. 500 Item 3-Rs. 500 Item 1-7/7/09-Rs 500 Item 2-9/7/09-Rs 700Item 3-8/7/09-Rs 800 Sales Voucher-2 Dated-8/7/09 Item 1-Rs. 400 Item 3-Rs. 800 Sales Voucher-3 Dated-9/7/09 Item 1-Rs. 300 Item 2-Rs. 700 Item 3-Rs. 500
TDL_Reference_Manual.pdf
What's New in Release 1. 5 68 7 Use : Name Field Set As : $$Context Keyword In this example, the functions returns the Title of the current report, i. e., “New Function Context Keyword”. If the parameter value Yes is specified, then the title of the report from where the repor t “Context Keyword Function” is called, will be returned. 5. New Attribute-Trigger Ex When a table is displayed from a field and a new value is to be added to the same table, the attribute Trigger is used. It invokes a report. For example, adding a new number in fields using dynamic tables such as Tracking number, Order No, etc. Syntax Trigger : <Report Name> : <Trigger Condition> Where, <Report Name> is the name of the report which is invoked if <Trigger Condition> is True. The value entered in the Output field of the <Report Name> is added to the table in the field. Example: [Field : Field Trigger] Use : Name Field Table : New Number, Not Applicable Show Table : Always Trigger : New Number : $$Is Sys Name Equal : New Number : $$Edit Data Common Table : No Dynamic : "" In the field "Field T rigger", a report "New Report" is called when the option New Number is selected from the pop-up table. When the value has to be obtained from the complicated flow, a report name does not suffice. T o support this functionality, a new attribute Trigger Ex is introduced. This attribute allows to add values to the dynamic table th rough an expression or user-defin ed functions. Attribute-Trigger Ex The Trigger Ex attribute allows to add values to the dynamic table through an expression or user- defined function. Syntax Trigger Ex : <Value-expression> : <Trigger Condition> Where, <Value Expression> is an expression/function which evaluates to a String if <Trigger Condition> is True. The string value thus obtained is added to the dynamic table.
TDL_Reference_Manual.pdf
What's New in Release 1. 5 688 Example: [Field : Field Trigger Ex] Use : Name Field Table : Ledger, New Number, Not Applicable Show Table : Always Trigger Ex : $$Field Trigger Ex : $$Is Sys Name Equal : + Not Applicable : $$Edit Data Common Table : No Dynamic : "" In the field, if the user selects any ledger from the table, the function $$Field Trigger Ex returns the parent, i. e., Group name of the ledger selected, and adds t o the table “Ledger”. [Function : Field Trigger Ex] 01 : RETURN : $Parent : Ledger : $$Edit Data 6. New Actions Two new actions-Log Object and Log T arget have been introduced to log the object, its method and collection contents. 6. 1 Action-Log Object The action Log Object has been introduced as a Global action. It accepts a filename a s the parameter. In this file, the context object, its method and collection ar e logged. Syntax Log Object [:<path\filename> [:<Overwrite Flag>]] Where, <path/filename> is optional. It accepts the name of the file, along with the pa th in which the log is created. If no file name is specified, the contents of the obje ct are logged in "TDLfunc. log" when logging is disabled, otherwise it logs into the Calculator pane. <Overwrite Flag> is used to specify whether the contents should be appended or o verwritten. The default value is NO, which appends the content in the file. If set to YES, the file is overwritten. Press Backspace in the report to view the additions to the table Ledger.
TDL_Reference_Manual.pdf
What's New in Release 1. 5 68 9 Example: [Function : Func Led Exp] | Object : Ledger |10 : Log Object : Ledger Obj. txt 6. 2 Action-Log T arget The action Log T arget is a function-specific action. It accepts filename as a parameter. In this file, the log of the object, its method and collection is created for the target object. Syntax Log Target [:<path\filename> [:<Overwrite Flag>]] Where, <path/filename> is optional. It accepts the name of the file along with the pat h in which the log is created. If no file name is specified, the contents of object a re logged in " TDLfunc. log" when logging is disabled, otherwise it logs into the Calculator pane. <Overwrite Flag> is used to specify whether the contents should be appended or o verwritten. The default value is NO, which appends the content in the file. If set to YES, the file is overwritten. Example: [Function : Func Led Exp] |05 : Set Target | 10 : Log Target : Ledger Obj. txt 7. T ally Command Line Parameters While executing T ally, now the following command line parameters can also be given: /NOINITDL This parameter will start T all y. ERP 9 without loading any TDL specified in the T ally. ini file. Syntax /NOINITDL /TDL This parameter will start T ally. ERP 9 with the specified TDL file loaded, and can be specified multiple times. The path can be optional, if the TDL file is in the T ally folder.
TDL_Reference_Manual.pdf
What's New in Release 1. 5 690 Syntax /TDL : <path\filename> Where, <path/filename> is the name of the TDL file, along with the path. /NOINILOAD This parameter will start T ally. ERP 9 without loading any Company specified in the T ally. ini file. Syntax /NOINILOAD /LOAD It starts T ally. ERP 9, with the specified company loaded, and c an be specified multiple times. Syntax /LOAD : <Company Number> /V ARIABLE This parameter allows to specify inline system variables of the specified data type, and can be specified multiple times. Syntax /VARIABLE : <Variable Name> : <Data Type> Where, <Variable Name> is the name of the inline variable. It must be unique. <Data T ype> is any of the primary data types. /SETV AR This parameter allows to specify the value of system variable o r inline variable. Syntax /SETVAR : <Variable Name> : <Value> Where, <Variable Name> is the name of system variable or inline variable. <Value> has to be any of the primary data types. /NOGUI This parameter hides the GUI (Graphical User Interface) of T all y. It performs the specified ACTION without showing the T ally interface based on a non-GUI o r GUI action. It starts T ally without showing the T ally window, performs the action and exits tally for non-GUI actions like executing a batch of job. If the action is a GUI action which i nvokes a report, menu or a message box, then the T ally window will be shown until the user quits. /ACTION This parameter starts the T ally application with the specified action and it quits the T ally application when the user exits.
TDL_Reference_Manual.pdf