Explore Categories

 

 PDF

Generic Operations Related Actions

Browse URL

The action Browse URL is enhanced to accept a logical value as an optional fourth parameter to open the URL in Admin mode.

Syntax

Action: Browse URL: <URL Formula>: [<Command Line Parameters>:<Logical Expression1>: <Logical Expression2>]

Where,

URL Formula > is an expression which evaluates to a link to a website or a folder path.

Command Line Parameters > is the list of command-line parameters separated by space. It is an optional parameter.

Logical Expression 1 > can be any expression which evaluates to a logical value. When this parameter is set to yes, it executes the given action in hidden mode. It is an optional parameter.

Logical Expression 2 > can be any expression which evaluates to a logical value. When this parameter is set to yes, it executes the action in admin mode. It is an optional parameter.

BrowseURLEx

As we are aware, there is an action Browse URL/Execute Command used to open a web page or invoke an external application. There may be cases where subsequent actions are dependent on the completion of the previous action, i.e., the closure of external application. For example, the current action is used to execute an external file, which unzips/ extracts various other files. The subsequent actions use these extracted files to process further. In such cases, Browse URL, when used, will trigger the requested application and continue executing the subsequent actions.

Hence, in order to bring sync between the calling and the called application, a new action Browse URL Ex/Execute Command Ex has been introduced. The Action Browse URL Ex, when triggered, waits till the external application is closed, and then allows the application to resume with the subsequent action. Similar to ‘Browse URL’, the Action ‘ BrowseURLEx ’ can be used to:

  • Open a web Page in the browser
  • Open an external file with its associated application
  • Run an executable application
  • Open a folder in explorer

BrowseURLEx is useful for URL, folder and executable without extension (e.g., tally instead of tally.exe), and it has similar behaviour as Browse URL.

Syntax

BrowseURL Ex : <URL/File path/executable file path/folder path> [:<Command line Parameters>]

Where,

<URL/File path/executable file path> can be:

  • A URL, which can be opened in a browser
  • A file, which is to be opened with its associated application
  • An executable file, which is to be run/executed
  • A folder, which is to be opened in the explorer

<Command line Parameters> is an optional parameter. For example, Zip application may need parameter d to decompress, c to compress, etc.

Example:1

To open a URL in browser:

Action : Browse URL Ex : “http://google.com”

Example: 2

To open a pdf file in pdf reader:

Action : BrowseURL Ex : “C:\report.pdf”

In this example, report.pdf will be opened in default PDF reader of the system. This can be useful while reading a report, which is exported in PDF format.

Example:3

To open an executable file and wait for it to complete:

Action : BrowseURL Ex: “C:\7zip.exe”: “D:\software.7z”

In this example, 7zip is opened and the application waits until it finishes, i.e., the running application first waits for 7zip.exe to finish decompressing of software.7z, and then it proceeds further.

Example:4

To open a folder:

Action : BrowseURL Ex : “C:\abc”

CALL

Action CALL can be used to call a function. It can be invoked from a Key, Menu Item or a Button.

Syntax

CALL : <Function Name> [: <Parameter List>]

Where,

< Function Name > is the name of a user defined function.

< Parameter List > is the list of parameters accepted by the function.

Example

Calling the Function as a procedure with CALL action

[#Menu : Gateway of Tally]

Button : Call Function

[Button : Call Function]

Key   : A l t + F9

Title : “ Call Function”

Call  : DispStaturoryRpts

 

Copy File

A new action Copy File has been introduced, which allows:

  • Copying from one location to another within the same System

  • Uploading of Files from a given Path to a FTP Site

  • Downloading of File from FTP Site to the specified location/folder

Syntax

Copy File : <Destination File Path> : <Source File Path>

Where,

<Destination File Path> can be any expression evaluating to a valid local/FTP path.

<Source File Path> can be any expression evaluating to a valid local/FTP path.

Example

CopyFile : ##MyDstFilePath : ##MySourceFilePath

If any of the File path is an FTP path, the same can be constructed using functions like $$MakeFTPName. It accepts various parameters like servername, username, password, etc. The following code snippet sets the value of the variable MyDstFilePath using the function $$MakeFTPName.

SET : MyDstFilePath : $$MakeFTPName:##SVFTPServer:##SVFTPUser:##SVFTPPassword:@SCFilePathName

The function $$MakeFTPName uses the various parameters which are System Variables captured from the default configuration reports.

 Do If

The action Do If which was used only as procedural action has been enhanced to support conditional action execution in other definitions like Button. Do If is a system action and it executes the given action when the condition evaluates to True.

Syntax

Do If: <Condition>: <Action Keyword>[:<Action Parameters>]

Where,

<Condition> is any value or expression that can be evaluated to true or false.

<Action Keyword> can be any global or object-specific action except the function-specific actions.

<Action Parameters> are the list of parameters as required by the action specified, separated by a colon. Depending on the specified action keyword this parameter can be optional.

Example 1: Do If in function definition

[Function: MastersCount]

……..

001 : Do If: (##MasterType = “Group”):Increment : GroupCount

002 : Do If: (##MasterType = “Ledger”):Increment: LedgerCount

Example 2: Do If in button definition

[Button: CreateMaster]

Title   : $$LocaleString:”Create Master”

Key     : Alt+F4

ActionEx: Group : Do If:(##MasterType = “Group”) : Create : Group

ActionEx: Ledger: Do If:(##MasterType = “Ledger”): Create : Ledger

In this example, if the value of the variable MasterType is Group it opens the default group creation screen, otherwise it opens the ledger creation screen.

Prior to Do If, the conditional action execution was possible using Switch/Option in button definition. Using the action Do If, reduces the number of lines in the code.

Example: Conditional action using Option

[!Form: Contra Color]

Local: Button: Print Button: Option: Vch Print: $$InCreateMode

Local: Button: Print Button: Option: Vch Chq Print: $$InAlterMode

[!Button: Vch Print]

Action: Print Report

[!Button: Vch Chq Print]

Action : Call : Voucher Printing

Example: Conditional actions using ActionEx

[!Form: Contra Color]

Local: Button: Print Button: Add: ActionEx: CreateMode:Do If: $$InCreateMode:Print Report

Local: Button: Print Button: Add: ActionEx: AlterMode:Do If: $$InAlterMode:Call:Voucher Printing

Exec COM Interface

A new action Exec COM Interface has been introduced to invoke the defined COM Interface.

Syntax

Exec COM Interface: <COM Interface name> [: <Parameter 1> [: <Parameter 2>…… [: <Parameter N>]…]]

Where,

<COM Interface Name> is the name of the COM Interface Definition.

[: <Parameter 1> [: <Parameter 2> …… [: <Parameter N> ]…]] are the subsequent parameters, which are passed considering the following aspects:

  • If the parameter corresponds to IN parameter, it can take any expression or constant.
  • If the parameter corresponds to an OUT or an InOut Parameter, then only the variable name must be specified, without prefixing a ##. In other words, expressions are not supported. The variable, in case of:
  • InOutParameter will send the variable value to the Interface as input, and in r e turn, will bring back the value altered by the Interface.
  • OUTParameter , will only bring back the updated value from the DLL .

In the previous TDL Code, three COM Interfaces are defined. A function is then called, inside which the action Exec COM Interface is used to invoke the COM interface definitions as follows:

[Function : TSPL Smp Execute COM Interfaces]

Variable : p1 : Number : 90

Variable : p2 : Number : 102

Variable : p3 : Number : 5

Variable : p4 : Number

Variable : pDate : Date

00 : Exec COM Interface : TSPL Smp Addition : ##p1

10 : Log : $$LastResult

20 : Exec COM Interface : TSPL Smp Division : ##p2 : ##p3 : p4

25 : Log : $$LastResult

30 : Log : ##p4

40 : Set : pDate : $$Date:”20-04-2013″

50 : Exec COM Interface : TSPL Smp AddDate :pDate

60 : Log : ##pDate

If this action is invoked from within a TDL function, then the Objects created are retained until all the Actions within the function are executed. This behaviour was designed so that multiple functions in a COM Class can be used on the same COM Object (state of COM Object is maintained). For instance, there are some functions of a COM server which depend on each other, and are required to be called in sequence, then the same object needs to be present and functions should be called on that same object to give correctness.

As a Global action, this would create a COM Object once per COM Interface execution. In other words, if there are two functions of a COM Server and they depend on each other, then this action would work only if used within a procedural Code.

 Exec Excel Macro

The action Exec Excel Macro invokes the available macros defined in the Excel.

Syntax

Exec Excel Macro : <Macro Name> [:<Parameter list>]

Where,

Macro Name > is the name of the macro.

Parameter list > can be n number of parameters that correspond to the parameters required by the Excel macro.

Example

On : After Export : Yes : Exec Excel Macro : MacrotoComputeGraphs : PieChart

In the above example, when the macro MacrotoComputeGraphs is executed, it displays the values in Excel as a pie chart.

Execute TDL

TDL action Execute TDL has been introduced to programmatically load TDL, perform some actions and subsequently, unload the TDL or keep the TDL loaded for the current Tally session.

This can prove to be very useful in cases where the user needs to programmatically associate a TDL on the fly, for performing some operations.

Syntax

EXECUTE TDL : <TDL/TCP File Path>[: <Keep TDL Loaded Flag> : <Action>: <Action Parameters>]

Where,

<TDL/TCP File Path> specifies the path of the TDL/TCP File to be loaded dynamically.

<Keep TDL Loaded Flag> is the Logical Flag to determine if the TDL should be kept loaded after the action is executed. If the value is set to YES, then the TDL will continue to be loaded, else the Executed TDL will be unloaded after the execution of the specified action.

<Action> specifies the global Action to be performed, i.e., Display, Alter, Call, etc.

<Action Parameters> are the parameters on which the Action is performed. For example:

  • If the action is Call, the Action Parameters contain the Function name along with the Function parameters, if any.
  • If the action is Display, Alter, etc., then the Parameter should be the Report Name.

Example: 1

[Function : TDL Execution with Keep TDL Loaded enabled]

00 : Execute TDL : “C:\Tally.ERP9\BSTitleChange.TDL” :Yes : Display : Balance Sheet

10 : Display : Balance Sheet

The file BSTitleChange.TDL contains the following lines of code:

[#Report: Balance Sheet]

Title : “TDL Executed Programmatically”

In this example, the TDL BSTitleChange.TDL , which is used to change the Title of the report Balance Sheet, is loaded dynamically by executing the action Execute TDL. The Keep TDL Loaded Flag is set to YES in the above code snippet. Based on the subsequent action Display: Balance Sheet, the Balance Sheet report will be shown with a new Title. The next statement also displays the Balance sheet. The title for this will again be the same, i.e., the changed title, as the dynamic TDL is still loaded, even after the action Execute TDL has completed its execution.

Example: 2

[Function : TDL Execution with Keep TDL Loaded enabled]

00 : Execute TDL : “C:\Tally.ERP9\BSTitleChange.TDL” : No : Display : Balance Sheet

10 : Display : Balance Sheet

Here, the report Balance Sheet would be displayed twice and the title of the first report is “TDL Executed Programmatically”, i.e., the changed title as per BSTitleChange.TDL ; whereas, in the second report, the title is Balance sheet, since the attribute Keep TDL Loaded Flag is set to NO.

Load TDL

An Action ‘ Execute TDL ’ was introduced  to load a TDL dynamically, execute some action, and then unload the TDL or keep it, depending on the Logical Value. With this Action, the TDL would get loaded. However, the execution of action was mandatory. An action Load TDL has been introduced to load the TDL/TCP dynamically for only the current session of Tally. However, if the TDL File is already loaded due to being specified in Tally.INI, or through previous execution of the Action ‘Load TDL’/‘Execute TDL’, it will not be loaded again. On closing the current session of TallyPrime, the dynamically loaded file(s) will not be available for the subsequent Tally Session.

Syntax

LOAD TDL : <TDL/TCP File Path Expression>

Where,

<TDL/TCP File Path Expression> evaluates to the path of the TDL/TCP File to be loaded dynamically.

Example

[Button : Load Dynamic TDL]

Key    : Alt + L

Action : Load TDL : @@TDLFilePath

[System : Formula]

TDLFilePath : “C:\Tally.ERP9\TDLSamples.tcp”

In this example, on triggering the button ‘Load Dynamic TDL’, the action ‘Load TDL’ loads the TDL from “C:\Tally.ERP9\TDLSamples.tcp”. If this TDL is already loaded due to being specified in Tally.INI, or previous execution of the Action ‘Load TDL’, then the same will not be loaded again.

 Local TDLs will be loaded at the Remote End if ‘Allow Local TDLs’ is enabled to the user logged in.

Unload TDL

To unload the TDL dynamically from the current Tally Session, the Action Unload TDL has been introduced. With this Action, the local TDL File(s), including the ones added through Tally.ini and those added dynamically using Actions ‘Load TDL’ or ‘Execute TDL’, can be unloaded. However, they would be unloaded only for the current Tally Session, and in the subsequent session, all the TDL/TCP files specified in Tally.INI will be loaded once again. Using this action, the Files can be unloaded by specifying either the TDL /TCP file name or the GUID of the TCP File.

Syntax

UNLOAD TDL : <TDL/TCP File Path Expression or GUID Expression>

Where,

TDL/TCP File Path Expression or GUID Expression > evaluates to the path of the TDL/TCP File or GUID of the TCP File to be unloaded dynamically.

Example

[Button : Unload Dynamic TDL]

Key    : Alt + U

Action : Unload TDL : @@TCPFileGUID

[System : Formula]

TCPFileGUID : “c29 0 1088-3 4 9b-434b – 946c-9 a da601fd 6 b7”

In this example, on triggering the button ‘Unload Dynamic TDL’, the Action ‘Unload TDL’ unloads the Compiled TDL with the GUID “c2901088-349b-434b-946c-9ada601fd6b7”. If the particular TDL is not found to be loaded, then the same is ignored. If the TCP File was dynamically loaded, then the same is removed from the List of TDL Files. However, if the TCP File was available in Tally.INI, then the same is removed temporarily and reloaded in the subsequent session of Tally.

  Account/Remote TDL file(s) cannot be unloaded using Action ‘Unload TDL’. Once a TDL is unloaded explicitly, if one attempts to load such TDL file(s) by changing the TDL Configuration, the file(s) will not be loaded in that session.

 Refresh TDL

A new Key/Button Action Refresh TDL has been introduced, which allows the TDL programmer to reload the active TDL Files, without having to restart Tally.

Syntax

Action : Refresh TDL

Example: Field acting as a hyperlink

[Key : Refresh TDLs]

;; Any Key can be assigned if Report already have F5 assigned

Key : F5

Action : Refresh TDL

;; Refresh TDL will work from any Report

[#Form : Default]

Key : Refresh TDLs

 

MULTISET

The action MULTI SET is used to set the values  of compound member variables in one call. All member specifications are relative to the compound variable specification given.

Syntax

MULTI SET : <CompoundVariable Specification> + : <Member Specification :Value> [, <Member Specification : Value>, …]

Where,

<Compound Variable Specification> is the Compound Variable 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 :($$AsAmount:10000)

All member variables of 1st element of Compound List Variable CLV EMP are set with MULTISET .

Example: 2

MULTISET : CLVEMP[1].Relatives[1] : Name : “Hari”, Age : 20, +

Relation:“Brother”

Here, all member variables for the first element of the Compound List Variable Relatives are set.

Relatives is a Compound List Member variable of the Compound List Variable CLV EMP.

Refresh Data

In Tally, whenever any report is being viewed, it contains the most recent updates till the last entry. If any report is left open and subsequently viewed later, possibly few more entries would have gone in the system entered by various other users on the Network. Hence, the report which is currently being viewed is older. To view the updated report, the user has to exit the report and once again, enter the Report. To solve this problem, a new action ‘Refresh Data’ has been introduced, which refreshes the data in memory automatically, as and when required.

Syntax

REFRESH DATA

Refresh Data can be used along with Timer Event and every few seconds, the Report can be refreshed automatically to display the updated information.

Example

[System : Event]

Refresh Timer : TIMER : TRUE : Refresh Data

[#Form : Balance Sheet]

Add : Keys : Enable Refresh

[Key : Enable Refresh]

Key    : Alt + R

Action : Start Timer : Refresh Timer : 300

In this example, Refresh Timer , a Timer event is declared under System Event to invoke the Action Refresh Data at periodic intervals. A key Enable Refresh is added in the Balance Sheet Report, which will be used to Start the Timer Refresh Timer every 5 minutes.

The action ‘Refresh Data’ is a Company Report – Specific Action. It will always require a Report in memory to Refresh the Data.

SLEEP

Action SLEEP has been introduced to specify time delays during the execution of the code. For few seconds, the system will be dormant or in suspended mode.

Syntax

SLEEP : <Duration in Seconds>

<SlEEP> is the action which halts the functioning of the Application for a few seconds as specified in <Duration in>.

Example:

[#Menu : Gateway of Tally]

Add : Item : Trial Balance after 10 secs : CALL : TBafterSleep

[Function : TBafterSleep]

00 : SLEEP : 10

10 : DISPLAY : Trial Balance

In this example, the system will halt for 10 seconds and display the Trial Balance subsequently.

Start Service

This action is used to start the specified service.

Syntax

StartService : <Service Name>

Stop Service

This action is used to stop the specified service.

Syntax

StopService : <Service Name>

Where,

<Service Name> can be any expression which evaluates to the name of the service.

Example

Action : Stop Service : “Tally.Server 9 – 1”

Where,

<Service Name> can be any expression which evaluates to the name of the service.

Example

Action : Start Service : “Tally.Server 9 – 1”

START TIMER

It starts the specified timer and accepts the Timer Name and Duration in seconds as the action parameters.

Syntax

START TIMER : <Timer Name> : Duration in seconds

Where,

<Timer Name> is the user defined name for the timer event.

 STOP TIMER

This action stops the specified timer, and it accepts the Timer Name as its parameter.

Syntax

STOP TIMER : <Timer Name>

Where,

<Timer Name> is the user defined name for the timer event.

Following is an example of scheduling automatic backups every hour:

Example

[System : Event]

;; Setting up timer event to call a function

Auto Backup : TIMER : TRUE : CALL : Take Backup Function

;; Starting the Timer when Tally Application Starts

Schedule Backup : System Start : TRUE : START TIMER : Auto Backup : 3600

;; Adding Keys to ‘Company Info’ Menu

[#Menu : Company Info.]

Add : Keys : Stop Backup Timer

;; Declaring a Key to Stop the Timer

[Key : Stop Backup Timer]

Key    : Alt + S

Action : Stop Timer : Auto Backup

Title  : “Stop Backup”

In this example, following is done:

  1. Auto Backup, a Timer event is declared under System Event to invoke the function
  2. Take Backup function at periodic intervals, as specified within the action Start Timer .
  3. Schedule Backup, a System Start event is declared under System Event to Start the above Timer ‘Auto Backup’ and execute the specified action every 3600 Seconds, i.e., every hour.
  4. A corresponding Key to Stop the Timer is associated to Menu Company Info, which is defined to Stop the Timer. User can stop the timer if he chooses not to continue taking automatic backups any further.

Timer events can be very useful in many cases like displaying Exception Reports , Negative Balances intimation, Inventory Status below Minimum or Reorder Level, Outstanding Reminders , Auto Sync at regular intervals, and many more.

 SUB ACTION

The purpose of this action is the same as START SUB – END SUB. The only difference is that this action takes an Action to be executed as a parameter. The former one encloses a set of Actions inside the block.

Following is the alternative of the previous code by using SUB ACTION, rather than using the START SUB – END SUB action block.

[Function : My User function]

01 : SUB ACTION : SET : My Variable : “First Value ”

02 : SUB ACTION : SET : My Variable : ##MyVariable + “, Second Value”

Action START SUB … END SUB

In evaluation mode, the dependent regenerations of UI elements are deferred till the function exit. In cases where it is desired to trigger regenerations based on the set of statements as and when they occur, one can enclose the statements within the START SUB – END SUB action block.

To articulate this better, let’s take the previous example, where the Variable is being accessed by a field. The following function, on a button press, changes the value of the Variable two times.

[Function : My User function]

01 : SET : My Variable : “First Value”

02 : SET : My Variable : ##MyVariable + “, Second Value”

In a normal scenario, as both SET actions are modifying the value of the variable, the field (dependent on this variable) would get re-valuated twice. However, the platform has the ability to do it only once during the end of the function by default, when the function is called in EVALUATION mode.

To change this behaviour to refresh the field twice, these two SET actions can be covered inside START SUB – END SUB as follows:

[Function : My User function]

01 : START SUB

02 : SET : My Variable : “First Value”

03 : SET : My Variable : ##MyVARIABLE + “, Second Value”

04 : END SUB

Action – SUB ACTION

The purpose of this action is the same as START SUB – END SUB. The only difference is that this action takes an Action to be executed as a parameter. The former one encloses a set of Actions inside the block.

Following is the alternative of the previous code by using SUB ACTION, rather than using the START SUB – END SUB action block.

[Function : My User function]

01 : SUB ACTION : SET : My Variable : “First Value ”

02 : SUB ACTION : SET : My Variable : ##MyVariable + “, Second Value”

Action START XSUB … END XSUB

In execution mode, the dependent regenerations are handled as and when they occur. In cases where we would like to defer regenerations based on the set of statements, we can enclose the statements within the START XSUB … END XSUB block.

Let’s take the following example to demonstrate this:

[Field : My Field]

Set as : $Value1 + $Value2

;; field value depends on the Value1 and Value2 of the current object

[Function: ModifyCurrentObj]

01 : SET VALUE : Value1 : “Somethi n g else”

02 : SET VALUE : Value2 : “Another value”

This code would normally cause the field to be re-evaluated twice during the function execution. However, enclosing it in an XSUB block would convert it into a single re-evaluation as below:

[Function : ModifyCurrentObj]

01 : START XSUB

02 : SET VALUE : Value1 : “Something else”

03 : SET VALUE : Value2 : “Another value”

04 : END XSUB

Action – XSUB ACTION

The purpose of this action is the same as START XSUB and END XSUB. The only difference is that this action takes an Action to be executed as a parameter. The former one encloses a set of Actions inside the block.

Following is the alternative of the previous code by using XSUB ACTION, rather than using the START XSUB … END XSUB block.

[Function : ModifyCurrentObj]

02 : XSUB ACTION : SET VALUE : Value1 : “Something else”

03 : XSUB ACTION : SET VALUE : Value2 : “Another value”

Trigger Key

When the macro keys are recorded using Key Recording Actions or when they are dumped into the Macros File from the Calculator Pane; in order to play them back, one needs to make use of the Action Trigger Key, which sends a list of keys in sequence to the system as if an operator is pressing those Keys.

Very often, some keys like Enter, Up, Down, etc., are repeated in sequence more than once. For example, to scroll down to the 7th Voucher in Daybook, one needs to trigger the Down Key 6 times. Similarly, in an Invoice Entry, moving to the first Item field needs multiple hits of Enter key. Hence, the action ‘Trigger Key’ has now been enhanced to support the <Key>:<Number> combination in the syntax, which will trigger the particular Key for the specified Number of times.

Example: 1

Trigger Key : DD, Enter : 5, “Item 1”, Enter

This is the same as:

Trigger Key : DD, Enter, Enter, Enter, Enter, Enter, “Item 1”, Enter

Following happens when the above Action is invoked from Gateway of Tally:

  • The First D navigates us to Display.
  • The Subsequent D navigates us to Daybook.
  • Enter:5 triggers the Enter Key 5 times, i.e., Drills down into the current voucher, accepts 4 subsequent non-skipped fields, and moves to the 5th non-skipped Field in the Voucher.
  • In the Fifth field, the text Item 1 is entered.
  • The Subsequent Enter then accepts the current field, and the focus is shifted to the next non-skipped field.

Example: 2

Trigger Key : DS, Enter:3

This action will take us through Display (D) -> Statement of Accounts (S) -> Outstandings (1st Enter) -> Receivables (2nd Enter) ; the 3rd Enter selecting the first item in the list and displaying all the outstanding bills within it.

WriteINI

This action is used to Add/Alter the value of any parameter in the specified INI file.

Syntax

WriteINI : <PathFileName> : <SectionName> : <Parameter> : [<Value> : [:<Index>]]

Where,

<PathFile Name> is the path and filename of the INI file

<Section Name> is the section name in the INI file

<Parameter> is the name of the parameter whose value is to be set in the INI.

<Value> is the value to be set for the given parameter. In the absence of any value, the existing value will be removed.

<Index> is an optional parameter. It can be used when multiple values are accepted for the same parameter. In the absence of the index parameter, the value of the last index will be updated.

Example

Action : WriteINI : “C:\Tally.ERP9\tally.ini” : ”TALLY” : ”UserTDL” : ”Yes”

XSUB ACTION

The purpose of this action is the same as START XSUB and END XSUB. The only difference is that this action takes an Action to be executed as a parameter. The former one encloses a set of Actions inside the block.

Following is the alternative of the previous code by using XSUB ACTION, rather than using the START XSUB … END XSUB block.

[Function : ModifyCurrentObj]

02 : XSUB ACTION : SET VALUE : Value1 : “Something else”

03 : XSUB ACTION : SET VALUE : Value2 : “Another value”

ZIP Actions

Zip action can be used to archive a set of folders/ files.

 ZIP

System action Zip is useful when a single File or Folder Source needs to be zipped into a Target file.

Syntax

Zip : <Target File> : <Source Path> [:<Password> [:<Overwrite> [:<Include Sub-directory> [:<Show Progress Bar>]]]]

Where,

<Target File> is the name of the Zip File to be created, along with the Path.

<Source Path> is the path of the Folder/File(s), which is to be zipped. It can be a folder, or a file path (with or without wildcard characters).

<Password> is the password assigned to the Target zipped file.

<Overwrite> is the Logical Flag to specify the behaviour of the Action, if the Target File already exists. If YES is specified, the file will be overwritten. If ‘NO’ is specified, the file will not be overwritten and will remain as it is. The default value is ‘NO’.

<Include Sub-directory> is the Logical Flag to specify whether to include sub directories available in the specified source path or not. If the Source Path ends with a Folder, the entire Folder along with its Sub-Folders will be zipped, irrespective of this parameter. If the Source Path ends with a File Name Pattern, i.e., with wild cards, this parameter will be considered. If a ‘YES’ is specified, all the files/sub-folders matching the wild card pattern will be included for Zipping. If ‘NO’ is specified, they will not be included. The default value is ‘NO’.

<Show Progress bar> is the Logical Flag to specify if the Progress Bar needs to be shown during the Zipping Process. If ‘YES’ is specified, the Progress Bar will be shown, and if ‘NO’ is specified, it will not be shown. If no value is specified, the default value will be assumed as ‘NO’.

Wild Cards * and ? are supported only for the last information in the path. For example, C:Wor?Cust*.txt is invalid whereas C:\WorkCust*.txt is valid.

Example: 1

ZIP : “.Target.zip” : “tally.ini”: “Tally” : No

With the above Action, the following will be achieved:

  1. The file tally.ini from the current Tally Application/Working Folder will be zipped to the File Target.zip in the Tally Application Folder itself.

  2. The resultant Zip File will contain the password Tally.

  3. If the file Target.zip exists in the current application folder, it will not be overridden.

Example: 2

To Zip all text files in work folder .

ZIP: “D:\Target.zip”: “D:Work*.txt”: “Tally”: No: Yes: Yes

With the above Action, the following will be achieved:

  • All the text files from the folder D:\Work will be zipped to the File Target.zip in D:\.

  • The resultant Zip File will contain the password Tally.

  • If the file Target.zip exists in D:\, it will not be overridden as the 4th Parameter is set to No.

  • All the text files within the Sub-directories will be included under the Folder D:\Work, as the 5th Parameter is set to Yes.

  • The Progress Bar will be shown during Zipping of the Files, as the 6th Parameter is set to Yes.

Procedural Actions – Start Zip, Zip Add Path, Zip Exclude Path and End Zip

Procedural Actions Start Zip, Zip Add Path, Zip Exclude Path and End Zip are very useful in cases where Multiple Folders/Files need to be zipped into / excluded from a Target File.

Syntax

Start Zip : <Target File> [: <Overwrite>]

Zip Add Path : <Source Path> [: <Include sub-directory>]

                  |

                  |

Zip Exclude Path : <Exclude Path>

                 |

                 |

End Zip [: <Password> [: <Show Progress Bar>]]

Where,

<Target File> indicates the name of the resultant Zip File , and also includes the Folder Path .

<Overwrite> is the Logical Flag to specify the behaviour of the Action, if the Target File already exists. If YES is specified, the file will be overwritten. If ‘NO’ is specified, the file will not be overwritten, and will remain as it is. The default value is ‘NO’ .

<Source Path> is the path of the Files or Folders, which are to be zipped. It can be a folder or a file path (with or without wildcard characters).

<Include Sub-directory> is the Logical Flag to specify whether to include sub directories available in the specified source path or not. If the Source Path ends with a Folder, the entire Folder along with its Sub-Folders will be zipped, irrespective of this parameter. If the Source Path ends with a File Name Pattern, i.e., with wild cards, this parameter will be considered. If a ‘YES’ is specified, all the files/sub-folders matching the wild card pattern will be included for Zipping. If ‘NO’ is specified, they will not be included. The default value is ‘NO’.

<Exclude Path> is the path of the Files/ Folders which need to be excluded from the Target Zip .

<Password> is the password assigned to the Target zipped file.

<Show Progress Bar> is the Logical Flag used to specify if the Progress Bar needs to be shown during the Zipping Process. If ‘YES’ is specified, then the Progress Bar will be shown, and if ‘NO’ is specified, it will not be shown. If no value is specified, the default value will be assumed as ‘NO’.

Example: 3

Start ZIP : “Target.zip” : Yes

/* Overwrite the File Target.zip, if it exists */

Zip Add Path : “tally.ini”

End Zip

The outcome of this example will be similar to the outcome of Example: 1. The only difference is that it is set to overwrite the target file Target.Zip , if it exists in the current application folder (as the <Overwrite> Parameter of the Action ‘Start Zip’ is set to Yes).

Example: 4

Start Zip : “Target.zip” : Yes

Zip Add Path : “.Tally.ini”

Zip Add Path : “D:\Documents*.doc” : Yes

/* Include Sub-Folders also */

Zip Add Path : “C:\Work”

/* The Folder Work and the Files within this folder will be included in the Zip File */

End Zip

In this example, there are 3 Source Paths, which are required to be zipped:

  • First Path indicates that the file Tally.ini from the current application folder is to be zipped.

  • The Second Path indicates that the PDF files from within the D:\Documents Folder, including the Sub-Folders, need to be zipped.

  • The Third Path indicates that the entire folder C:\Work needs to be zipped.

The above source files would be zipped to the target file Target.zip, which is specified in the Action Start Zip.

Example: 5

Start Zip : “Target.zip” : Yes

/* Overwrite the existing file in the target location */

Zip Add Path : “.Tally.ini”

Zip Add Path : “D:\Documents*.doc” : Yes

/* Include Sub-Folders also */

Zip Add Path : “C:\Work”

Zip Exclude Path : “*.txt”

End Zip

In this example, apart from using Action Zip Add Path to specify the first 3 source paths, the subsequent Action Zip Exclude Path is used to specify the exclusion of Folders or Files with the extension .txt. Thus, all the text files from the above specified source paths will be excluded.

UNZIP 

The Unzip action can be used to extract the original files from the zipped files.

System Action – UNZIP

System Action Unzip is useful when all the folders/ files in the Source Zip File need to be completely unzipped, as they are. (This Action cannot be used in case of partial Unzip.)

Syntax

Unzip : <Target Folder>: <Source File> [: <Password> [: <Overwrite> [:<Show Progress Bar>]]]

Where,

<Target Folder> is the path of the Target folder where the Unzipped Files need to reside.

<Source File> is the name of the Zip File to be unzipped.

<Password> is the Zip File Password. A Zip File bearing a Password cannot be extracted without the Password.

<Overwrite> is the Logical Flag to specify the behaviour if the Files being unzipped already exist in the Target Folder. The default value is ‘NO’.

<Show Progress Bar> is the Logical Flag to specify if Progress Bar needs to be shown during the Extracting (Unzipping) Process. If YES is specified, the Progress Bar will be shown and if NO is specified, the Progress Bar will not be shown. The default value is ‘NO’ .

Example: 1

Unzip : “.” : “D:\Target.zip” : “Tally”

In this example, the file D:\Target.zip will be unzipped entirely in the current Tally Application Folder. Since the Zip File bears a password Tally, same is being passed as the 3rd Parameter.

Example: 2

Unzip : “Documents” : “D:\Target.zip” : “Tally”

In this example, all the folders/ files within the Zip File D:\Target.zip will be extracted to the folder Documents in the current Tally Application folder.

Procedural Actions – Start Unzip, Extract Path, Unzip Exclude Path and End Unzip

The Procedural Actions Start Unzip , Extract Path , Unzip Exclude Path and End Unzip are very useful in case of partial Unzip . Using the Action ‘Extract Path’, one can specify the Folder/ File Path to be marked for extracting. The action ‘Unzip Exclude Path’ can help to exclude the specified Folders/ Files from the Zip File and extract the rest. These actions can be used in both the cases, i.e., for partial unzip as well as for total unzip.

Syntax

Start Unzip : <Source File> [: <Password>]

Extract Path : <Folder/ File Path>

|

|

Unzip Exclude Path : <Folder/ File Path>

|

|

End Unzip : <Target folder> [:<Overwrite> [:<Show Progress Bar>]]

Where,

<Source File> is the path of the Zip File which needs to be zipped.

<Password> is the password to access the Target zipped file.

<Extract Path> is the File/ Folder which need to be extracted from the Zip File.

<Unzip Exclude Path> is the path of Files/ Folders, which need to be excluded from the unzipping operation.

<Target Folder> is the path of the Target folder, where the Unzipped Files need to reside.

<Overwrite> is the Logical Flag to specify the behaviour if the Files being unzipped already exist in the Target Folder. The default value is ‘NO’.

<Show Progress Bar> is the Logical Flag to specify if Progress Bar needs to be shown during the Extracting (Unzipping) Process. If YES is specified, the Progress Bar will be shown and if NO is specified, the Progress Bar will not be shown. The default value is ‘NO’.

Example: 3

Start Unzip: “D:\Target.zip”

End Unzip : “D:\Unzipped” : Yes

/* Overwrite the existing files, if any, in the Target Folder */

These actions will unzip all the folders/ files within D:\Target.zip to the folder D:\Unzipped and if any file already exists, the same will be overwritten (as the second parameter of the Action End Unzip is set to Yes.)

Example: 4

To extract only .txt and .doc files from the zip file.

Start Unzip  : “D:\Target.zip”

Extract Path : “*.txt”

Extract Path : “*.doc”

End Unzip    : “.”

In this example, only the *.txt and *.doc files from D:\Target.zip will be unzipped to the current Tally Application Folder.

Example: 5

Start Unzip        : “D:\Target.zip”

Extract Path       : “SamplesSupporting Files”

Unzip Exclude Path : “*.xls”

End Unzip          : “.”

In this example, from D:\Target.zip , all the Files and SubFolders within the folder ‘Supporting Files’ under ‘Samples’ will be unzipped to the current Tally Application Folder, as the target folder is specified as a dot (.). Also, all the files with extension .xls will not be zipped.

A file which has been zipped from Tally.ERP 9 or TallyPrime can be extracted by using any standard third party archiving tools like Winzip, Winrar, etc., and vice-versa.

Limitations of Zip/Unzip:

In the following cases, Zip/Unzip action will fail:

  • If the number of files being Zipped is greater than 65535
  • If the Size of the Zip File is greater than or equal to 4 GB
  • If the Size of any File within the Zip File is greater than or equal to 4 GB

Action – DisconnectUser

This action is used to disconnect the users from companies that are accessed from Tally.Server9. It will display a warning message to the clients to close the company within 2 minutes, before forcing a close.

Syntax

DisconnectUser : <Tally Server Name> : <Company Name> : <User Name>

Where,

<Tally Server Name> is the name of the Tally.Server9, from which the companies are being accessed.

<Company Name> is the name of the company to be disconnected. ‘*’ can be used to specify all companies.

<User Name> is the name of the user to be disconnected from the company specified. ‘*’ can be used to specify all the users across companies.

Example

Action : DisconnectUser : “HoServer” : * : “abc@abc.com”

Action – ForceDisconnectUser

It is used to forcefully disconnect users from companies that are accessed from Tally.Server 9.

Syntax

ForceDisconnectUser : <TallyServer Name> : <Company Name> : <User Name>

Where,

<Tally Server Name> is the name of the Tally.Server 9 from which the companies are being accessed.

<Company Name> is the name of the company to be disconnected. ‘*’ can be used to indicate ‘all companies’.

<User Name> is the name of the user to be disconnected from the company specified. ‘*’ can be used to indicate ‘all users across companies’.

Example

Action : ForceDisconnectUser : “HoServer” : * : “abc@abc.com”

TallyHelpwhatsAppbanner
Is this information useful?
YesNo
Helpful?
/* */