https://help.tallysolutions.com/docs/td9rel54/tdl_reference/release_1_5.htm

What’s New in Release 1.5

Collection Enhancements

TDL supports the hierarchical database structure. While designing 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 three 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 based on the source object or the current object value, and the filtration is done based on the value evaluated with respect to final objects before populating the collection. In these cases, to evaluate value based on the changing object context is tiresome, and sometimes impossible as well.

The newly introduced concept of collection level variables provides 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 Var’, ‘Source Var’ and ‘Filter Var’. The variables defined using attributes ‘Source Var’ and ‘Compute Var’ 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 while evaluating the current collection objects. Sometimes, it is not possible to get the value of the object from the current object context. In such scenarios, these variables are used.

Collection Attributes - Source Var, Compute Var, Filter Var

Attribute - Source Var

The attribute Source Var evaluates the value of the variable based on the source object.

Syntax

Source Var : <Variable Name> : <Data Type> : <Formula>

Where,

< Variable Name > is the name of the variable.

< Data Type > is the data type of the variable.

< Formula > can be any expression formula, which evaluates to a value of ‘Variable’ data type.

Example

Source Var : Log Var : Logical : No

The value of the variable LogVar 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 Type > is the data type of the variable.

< Formula > can be any expression formula which evaluates to a value of ‘Variable’ data type.

Example

Compute Var : IName:String : if ##LogVar then $StockItemName else ##LogVar

Attribute - Filter Var

The attribute Filter Var evaluates the value of the variable based on the objects available in the collection, after the evaluation of attributes Fetch and Compute.

Syntax

Filter Var : MyFilVar : <Data Type> : <Formula>

Where,

< Variable Name > is the name of the variable.

< Data Type > is the data type of the variable.

< Formula > can be any expression formula which evaluates to a value of the ‘Variable’ data type.

Example

Filter Var : Fin Obj Var : Logical : $$Number:$BilledQty > 100

Sequence of Evaluation of Collection Attributes

The collection attributes are evaluated as per the following sequence, before populating the collection:

1. Source Collection

2. Source Var

3. Walk

4. Compute Var

5. By

6. Aggr Compute

7. Compute

8. Filter Var

9. Filter

With the introduction of these attributes, the calls to the functions $$Owner, $$ReqObject, $$FilterValue, $$FilterAmtTotal, etc., can be reduced.

Usage of the Collection attributes - Source Var, Compute Var, 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 objects in the collection, Compute var is evaluated. Consider the following Collection Definition:

[Collection : Test ComVar]

Type        : Group

Compute Var : CmpVarColl : String : $Name

Compute     : MyAmt : $$CollamtTotal:TestComVarSub:$OpeningBalance

[Collection : Test ComVar Sub]

Type     : Ledger

Child Of : ##CmpVarColl

Fetch    : Name, OpeningBalance

The sequence of evaluation is as follows:

1. Type attribute is evaluated, and the objects of the specified type are 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 ‘CmpVarColl’.

3. For this selected group, the method $MyAmt is evaluated. This gives the total amount of all the ledgers belonging to the group in the variable ‘CmpVarColl’.

4. Steps 2 and 3 are repeated for each group in the collection ‘Test ComVar’.

5. After computing the value of the method $MyAmt for each group, the collection is populated with the objects.

The variable ‘CmpVarColl’ 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 attributes, 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      : IsSalesVT

Compute Var : Src Var : Logical : $$IsSales:$VoucherTypeName

[Collection : Smp Stock Item]

Source Collection : CFBK Voucher

Source Var        : Str Var: String : $VoucherNumber "/" $VoucherTypeName

Walk              : Inventory Entries

Compute Var       : IName: String : if ##StrVar CONTAINS "12" then $StockItemName else $StockItemName +

"-" $$String : ##StrVar

By                : IName: ##IName

Aggr Compute      : BilledQty: SUM: $BilledQty

Filter Var        : Fin Obj Var : Logical : $$Number:$BilledQty > 100

Filter            : Final Filter

[System : Formula]

IsSalesVT : ##SrcVar Final Filter : ##FinObjVar

The evaluation process is as follows:

1. Value of the variable SrcVar 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 Variable Src Var contains "12”, then the variable IName stores only the StockItemName 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 $BilledQty is computed.

7. The variable Fin Obj Var retains a logical value, if the method $BilledQty 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.

List Variables Introduced

The TDL programmer community is aware of the functionality of variables, 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:

1. Report Level – commonly referred to as Local Variables .

2. System Level – commonly referred to as Global variables .

3. Function Level – Local variables used inside User-defined functions.

The variable framework has been enhanced to support a new type of variable called ‘List Variable’, which allows us to perform complex calculations on data available from multiple objects.

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'. The '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 Type > is the data type of the variable. It is Optional. If it is specified, a separate Variable definition is not required. If not specified, a variable definition with same name must be specified.

Example

[Function : Test Function]

ListVariable : List Var : String

The variable List Var can hold multiple string values.

Example

[Report : Test Report]

ListVariable : 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 functions for data manipulation, which will be explained in the following section.

List Variable Manipulation

List variable supports various data manipulation operations, which include:

Adding/Deleting Values – Actions List Add and List Delete

Populating List Var from a Collection – Action List Fill

Accessing List Variable values – Function $$ListValue

Sorting the values in the List Variable

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>

Where,

< List Var Name > is the name of the list variable.

< Key Formula > can be any expression formula which evaluates to a unique string 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 : TestFuncVar : "Mobile" : 9340193401

LIST ADD : TestFuncVar : "Office" : 08066282559

LIST ADD : TestFuncVar : "Fax" : 08041508775

LIST ADD : TestFuncVar : "Residence" : 08026662666

The four values inserted in the list variable 'Test Func Var' are identified by the key values 'Mobile', 'Office', 'Fax' and 'Residence' respectively.

Note : The same List is considered in explaining the further examples.

To add multiple values dynamically in the list variable, looping 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 string value. In the absence of key formula, all the values in the list will be deleted. In other words, if key formula is omitted, the list is reset.

Example: 1

LIST DELETE : TestFuncVar : "Office"

The value identified by the key 'Office' is deleted from the list variable 'Test Func Var'.

Example: 2

LIST DELETE : TestFuncVar

All the values in the list variable TestFuncVar 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 Variable.

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 list variable.

Example

LIST FILL : TestFuncVar : Group : $Name : $Name

Accessing List variable values

To 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 - $$ListValue

$$ListValue returns the value identified by the given key in the list variable.

Syntax

$$ListValue : <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

$$ListValue:TestFuncVar:"Mobile"

In this example, the function returns the values identified by the key 'Mobile' from the list variable 'TestFuncVar', when the function is executed.

Sorting values in a List variable

By default, the values in the list variable are sorted in the order of entry. TDL provides the facility to sort the values in the list variable either by key or by value. The data type can be specified while

sorting based on key. Following actions allow to change the sort order:

1. List Key Sort

2. List Value Sort

3. 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 Number , 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 temporarily convert the original data type to the specified data type while comparing the elements for sorting 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 type, 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 Type > 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 of the key.

Example: 2

In 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 becomes 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 will be sorted in the following order: 9340193401, 08066282559, 08041508775, and 08026662666.

In case the key contains numeric values like "11", "30", "35" and "20", which can be converted to Number, the list is sorted based on the key values, else it converts them to ZERO and sorts the list as per the order of insertion.

Action - LIST VALUE SORT

Action LIST VALUES 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 VALUE 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 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 Type > 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 of 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 'Test Func Var' to the order of insertion.

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 - $$ListValue

As explained earlier in section 2.1, this function is used to access values from a list variable.

Function - $$ListCount

The function $$ListCount gives the total number of values available in the list variable.

Syntax

$$ListCount : <List Var Name>

Where,

< List Var Name > is the name of the list variable.

Example

$$ListCount:TestFuncVar

The action returns the number of items in the list variable 'Test func Var', when it is executed.

Function - $$ListFind

The function ListFind is used to search if the value belonging to a specific key is available in the list variable. If the key is found, $$ListFind returns TRUE, otherwise it returns FALSE.

Syntax

$$ListFind : <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

$$ListFind:TestFuncVar:"Mobile"

It returns TRUE if the key ‘Mobile’ is present in list variable ‘Test func Var’, else returns FALSE.

Note: Function $$LastResult 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 FALSE otherwise.

If the last action that was executed is LIST FILL, then $$LastResult returns the number of items inserted in the list variable.

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 created implicitly.

< List Var Name > is the name of the list variable.

Example

FOR IN : Cnt : Test Func Var

LOG : $$String:$$ListValue:TestFuncVar:##Cnt END FOR

All the values of the list variable 'Test Func Var' are logged in the file 'tdlfunc.txt'.

Dynamic Actions

A new capability has been introduced with respect to Action framework, 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 inherently 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 has been achieved with the introduction of a new keyword "Action".

‘Action’ Keyword

The ‘Action’ keyword allows the programmer to execute actions based on dynamic evaluation of parameters. The syntax for specifying the same is as given below:

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

Dynamic Actions in Key/Button Definition

[Button : Test Button]

Key : F6

Action : Action : Display : @@MyFor

;; The Button Test Button initiates a dynamic Action which takes the parameter as a formula.

[System : Formula]

MyFor : if ##SVCurrentCompany CONTAINS "ABC" Then "BalanceSheet" else "TrialBalance"

Note: 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.

Dynamic Actions in User Defined Functions

[Button : Test Button]

Key : F6

Action : Call : TestFunc : "Balance Sheet"

[Function : Test Func]

Parameter : Test Func : String

01 : Action : Display : ##TestFunc

;;The function Test Func executes a dynamic action, which takes Action parameter as the parameter passed to the function.

New Functions

In this release, two new functions have been introduced - $$TgtObject and $$ContextKeyword.

Function – $$TgtObject

In TDL, normally all evaluation is done in context of the Context object. With the introduction of aggregate collections and user-defined functions, apart from the Requestor Object context and Source Object context, now the Target Object context is also available.

The object which is being populated or altered is referred to as the Target object. 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 Object is different.

There are scenarios where the expression needs to be evaluated in the context of the Target object. In such cases, the function $$ TgtObject can be used.

Function – $$TgtObject

The new Context Evaluation function $$TgtObject evaluates the expression in the context of the Target Object. Using $$TgtObject, values can be fetched from the target object without making the target object as the context object.

Syntax

$$TgtObject : <String Expression>

Where,

< String Expression > is the expression which will be evaluated in the context of Target Object.

Usage of $$TgtObject in User Defined Functions

In a user defined function, while setting the method values of target object, the expression needs to be evaluated in the context of the target object itself. $$TgtObject 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 : OpeningBalance : $OpeningBalance +

$$TgtObject:$OpeningBalance:ACCEPT ALTER

;; By prefixing $$TgtObject to the opening balance, the closing balance of the Target Object, i.e., Party 2, is retrieved.

Here, ‘Party 1’ is the Source object and ‘Party 2’ is the Target object. The opening balance of ‘Party 2’ is accessed using the expression $$TgtObject:$OpeningBalance.

Usage of $$TgtObject 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 object is different.

The function $$TgtObject allows to access the values from the target object itself, while the collection is being populated. It is required in aggregate collection, where the source object is not the same as the target object.

The function $$TgtObject is useful when the values are to be populated in collection, based on the values that have been computed earlier. In aggregate collections, the function $$TgtObject 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 date on which the maximum quantity of the item is sold and the maximum amount is received.The collection is defined as follows:

[Collection : Src Voucher]

Type    : Vouchers : VoucherType

ChildOf : $$VchTypeSales

[Collection : Summ Voucher]

Source Collection : Src Voucher

Walk              : Inventory Entries

By                : ItemName : $StockItemName

Aggr Compute      : MaxDate : SUM : IF $$IsEmpty:$$TgtObject:$ItemDet OR $$TgtObject    : $ItemDet < $Amount THEN $Date ELSE $$TgtObject:$MaxDate Aggr Compute:ItemDet:MAX: $Amount

While creating a collection “Summ Voucher”, $$TgtObject is used to get the date on which the maximum sales amount is received for each stock item. $ItemDet gives the maximum amount received for individual item. In the condition checking part, if the evaluated $ItemDet 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 $MaxDate is retained.

Following Table shows the evaluation of values with respect to the target object:

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 700

Item 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

Function – $$ContextKeyword

A new function $$ ContextKeyword 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 Report or Menu title.

Syntax

$$ContextKeyword [: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]

Use    : Name Field

Set As : $$ContextKeyword

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 report “Context Keyword Function” is called, will be returned.

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 : FieldTrigger]

Use        : Name Field

Table      : New Number, Not Applicable

Show Table : Always

Trigger    : New Number : $$IsSysNameEqual:NewNumber:$$EditData

CommonTable: No

Dynamic    : ""

In the field "FieldTrigger", 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. To support this functionality, a new attribute Trigger Ex is introduced. This attribute allows to add values to the dynamic table through an expression or user-defined functions.

Attribute - Trigger Ex

The Trigger Ex attribute allows to add values to the dynamic table through an expression or user- defined function.

Syntax

TriggerEx : <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.

Example

[Field : FieldTriggerEx]

Use           : Name Field

Table         : Ledger, New Number, Not Applicable

Show Table    : Always

TriggerEx     : $$FieldTriggerEx:$$IsSysNameEqual:NotApplicable:$$EditData

CommonTable   : No Dynamic : ""

In the field, if the user selects any ledger from the table, the function $$FieldTriggerEx returns the parent, i.e., Group name of the ledger selected, and adds to the table “Ledger”.

[Function : FieldTriggerEx]

01 : RETURN : $Parent : Ledger : $$EditData

Note: Press Backspace in the report to view the additions to the table Ledger.

New Actions

Two new actions - LogObject and LogTarget have been introduced to log the object, its method and collection contents.

Action - Log Object

The action Log Object has been introduced as a Global action. It accepts a filename as the parameter. In this file, the context object, its method and collection are logged.

Syntax

Log Object [:<path\filename> [:<Overwrite Flag>]]

Where,

< path/filename > is optional. It accepts the name of the file, along with the path in which the log is created. If no file name is specified, the contents of the object 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 overwritten. The default value is NO, which appends the content in the file. If set to YES, the file is overwritten.

Example

[Function : FuncLedExp]

|

Object : Ledger

|

10 : Log Object : LedgerObj.txt

Action - Log Target

The action Log Target 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 path in which the log is created. If no file name is specified, the contents of object 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 overwritten. The default value is NO, which appends the content in the file. If set to YES, the file is overwritten.

Example

[Function : FuncLe d Exp]

|

05 : Set Tar g et

|

10 : Log Target : LedgerObj.txt

Tally Command Line Parameters

While executing Tally, now the following command line parameters can also be given:

/NOINITDL

This parameter will start Tally.ERP 9 without loading any TDL specified in the Tally.ini file.

Syntax

/NOINITDL

/TDL

This parameter will start Tally.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 Tally folder.

Syntax

/TDL : <path\filename>

Where,

< path/filename > is the name of the TDL file, along with the path.

/NOINILOAD

This parameter will start Tally.ERP 9 without loading any Company specified in the Tally.ini file.

Syntax

/NOINILOAD

/LOAD

It starts Tally.ERP 9, with the specified company loaded, and can be specified multiple times.

Syntax

/LOAD : <Company Number>

/VARIABLE

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 Type > is any of the primary data types.

/SETVAR

This parameter allows to specify the value of system variable or 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 Tally. It performs the specified ACTION without showing the Tally interface based on a non-GUI or GUI action. It starts Tally without showing the Tally 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 invokes a report, menu or a message box, then the Tally window will be shown until the user quits.

/ACTION

This parameter starts the Tally application with the specified action and it quits the Tally application when the user exits.

Syntax

/ACTION : <Action Name> [:<Action Parameter>]

Where,

< Action Name > is the name of any of the Global actions.

< Action Parameter > is optional. It has to be specified based on the action.

/PREACTION

This parameter starts Tally, loads the company and executes the specified action before displaying the Main Menu of Tally.

Syntax

/PREACTION : <Action Name> [:<Action Parameter>]

Where,

< Action Name > is the name of any of the Global actions.

< Action Parameter > is optional. It has to be specified based on the action.

/POSTACTION

This parameter starts Tally, loads the company and executes the specified action when the user quits Tally.

Syntax

/POSTACTION : <Action Name> [:<Action Parameter>]

Where,

< Action Name > is the name of any of the Global actions.

< Action Parameter > is optional. It has to be specified based on the action.

Note: Only o n e of the acti o n p ar a mete r s can be specified at a tim e .  T h e actions specified with / PREACTION a n d / P O S T ACTION are not executed e a ch ti m e the Tally application is r esta r ted, d u e to the c h ange in co nf iguration setti n gs. T h e act i on specified with / PREACTION is exe c u t ed when Tally sta r ts for t he F i r st ti m e. T h e a ction specified with / POS T ACTION is e x ecuted during the L a st e xit from Tally application.

Example

Considering that "C:\Tally.ERP 9" is the Folder where Tally.exe is available. The corresponding TDL file "BackUP.txt" for functions is available in the sample folder.

/NOINITDL & /TDL

"C:\Tally.ERP 9\Tally.exe" /NOINITDL /LOAD:00009 "/TDL:C: \Tally.ERP 9 \TDL \SecurityTDL.txt" /TDL:MasterTDL.txt

This command expression ignores all the TDLs specified in Tally.ini file while loading Tally. It starts Tally application and loads the TDLs ‘SecurityTDL.txt’ and ‘MasterTDL.txt’.

/NOINILOAD with /LOAD

"C:\Tally.ERP 9 \Tally.exe" /NOINILOAD /LOAD:00009

This command expression ignores all the companies specified in Tally.ini file while loading Tally. It starts Tally application and loads the company identified by 00009.

/VARIABLE

"C:\Tally.ERP 9 \Tally.exe" /LOAD:00009 /VARIABLE : MyLogicalVar : Logical

This command expression starts the Tally application, and with a logical variable MyLogicalVar.

/SETVAR and /ACTION

"C:\Tally.ERP9 \Tally.exe" /SETVAR:ExplodeFlag : Yes/LOAD : 00009 /ACTION : DISPLAY : TrialBalance

This command expression sets the value of the variable ExplodeFlag to YES and directly displays the Trial Balance report.

/PREACTION

"C:\Tally.ERP 9 \Tally.exe"/LOAD : 00009/PREACTION : CALL : BackupBeforeEntry

This command expression starts Tally application, loads the company identified by 00009 and calls the function “ BackUpBeforeEntry before displaying the main menu.

/POSTACTION

"C:\Tally.ERP 9 \Tally.exe" /LOAD:00009 /POSTACTION : CALL : BackupOnExit

This command expression starts Tally application, loads the company 00009, and calls the function BackupOnExit, when the user quits Tally.

/NOGUI

"C:\Tally.ERP 9 \Tally.exe" /NOGUI /LOAD : 00009 /ACTION : CALL : BackupSchedule

This command expression starts the Tally application, and executes the function BackupSchedule, without displaying the Tally window.