Developer Mode
In market, there are customers using TallyPrime for their day-to-day operations. There are also developers/ partners who build solutions within the product to suit the customer requirements. For the entire spectrum of persons using TallyPrime, the only mode of execution available until now was the default mode. In order to empower the developers of Tally with various tools which will help them to build solutions optimally and efficiently, the very new Developer Mode has been introduced.
From Tally.ERP 9 Release 4.6 onwards, Tally can operate in 2 modes, viz. Normal Mode which will be used by the end users, and the Developer Mode , which will be used by the developers. The Developer mode will offer various tools for debugging the code and optimizing the performance of reports.
The various Tools introduced for TDL Developers in Developer Mode are:
Profiler is a very useful tool in the hands of the TDL Programmer. Usually, any requirement can be achieved in multiple ways using TDL. But, it is highly difficult for the programmers to choose the optimal way. Using Profiler, programmers can check the time taken to execute each TDL artefact, along with the count of how many times they have been executed. This ensures redundancy check, and the code can be optimized for the best performance and user experience.
This is a very handy tool for the TDL Programmer. At times, while writing complex expressions for huge projects, it becomes difficult to identify the expression that has failed. Usually, for debugging such code, TDL Programmers had to resort to invoking User Defined Functions and logging the values to trace the point of failure. With Expression Diagnostics, now the system automatically dumps every expression along with their resultant value in the log. For expressions which have failed to execute, the resultant value would be set to FAILED. With this, the programmer can easily reach the exact expression that has failed and correct the same without much delay. This would save a lot of programmer’s time, which can be used for other projects.
This feature will be useful in instances where developers require to execute certain keystrokes repetitively to test/ retest the code output and confirm if the same is in line with the customer requirement. It will help in doing automated QA and ensuring utmost quality for the customer. For instance, if a data entry screen has been customised by incorporating additional fields, sub-forms, etc., then in order to validate if the data entry performance is affected, one can record the keystrokes for saving a voucher, and replay them as many times as required. From Release 4.7 onwards, the reading capacity of the Function $$FileRead has been increased from 2000 to 4000 characters per line.
While developing extensions on Tally, developers usually navigate through default TDL to locate the appropriate definition name and alter their attributes within their code. At times, it becomes very difficult for the developers to identify the right field names, since there are several options at various stages and finding the right ones requires a lot of effort. Hence, to make developer’s life easier, a very critical tool, i.e., the Onscreen Tooltip, has been introduced. When the mouse pointer is placed on a Field, the definition name of the Field is displayed. If the pointer points at a place where no field exists, the definition name of the Report is displayed.
All these Tools/Enhancements will be available only if the developer executes Tally in Developer Mode, using the Command Line Parameter DevMode.
Command Line Parameter – DevMode
Command Line Parameter DevMode has been introduced to execute Tally in Developer mode.
Syntax
<Tally Application Path>Tally. exe/DevMode
Example
C:\Tally.ERP9\Tally.exe /DevMode
Developers must not execute the above at the Client end unless required, because if the client continues to work in this mode, it might affect the performance adversely.
Function – $$InDeveloperMode
This function is used to check if Tally is currently working in Developer mode. It returns TRUE if the Tally application is in Developer Mode, else returns FALSE.
This tool can be used when the developer needs to write some additional code for testing purpose, so that the testing code does not appear to the end user, thereby executing only if the product is running in Developer Mode.
Syntax
$$InDeveloperMode
Example
Option : DevModeDefaultMenu : $$InDeveloperMode
Extensive use of this function in the TDL code may lead to performance issues even in Normal mode.
Output Profiler and Expression Diagnostics Information in Excel Format
Microsoft Excel is widely used in organizations for representing their Tabular data, as it comes with a galaxy of features for data representation. It is, therefore, ideal to output any tabular data in Microsoft Excel format, for easier and better data analysis.
From Release 4.7, the tabular Profiler or Debugger Expression data will dump the information in
Excel Format, to enable the developer to analyze the data with ease. The behaviour will be:
- If the System has MS Office 2007 or below, then the output format will be ‘.xls’.
- If the System has MS Office 2010 or above, then the output format will be ‘.xlsx’.
- If the System does not have MS Office installed, then the behaviour will be the same as in Release 4.6, i.e., the format will be text files.
Thus, the developer can make use of Excel features like sorting, filtering, graphical representation, etc., thereby attaining performance optimization quickly. For example, by sorting the Profiled Information in descending order of Time or Count, the developer can quickly determine the artefact that has taken the longest time or the Collection that has been needlessly gathered multiple times, thus optimizing the performance quickly.
Calculator Pane Changes
For the convenience of the developer, the following calculator pane commands can be used.
Command – Mode: ?
Mode: ? will list all the modes available in the Calculator Panel.
Command – Help
From any of the modes, Help command will list down all the supported commands for the particular mode, along with their purpose.
Command – Open
From any of the modes, the Open command will open the most recently logged file. Consider the following examples:
- If the current mode is Debug, the file being opened will be either debug.xlsx, debug(1). xlsx, debug(2).xlsx, ……. or debug(<n>).xlsx, whichever is the most recent in debugger log. (Depending on the available Excel Version, the file extensions will vary.)
- If the current mode is Profile, the file being opened will be either tdlprof.xlsx, tdlprof(1). xlsx, tdlprof(2).xlsx, ……. or tdlprof(<n>).xlsx, whichever is the most recent in profiler log. (Depending on the available Excel Version, the file extensions will vary.)
- If the current mode is Record, the file being opened will be macros.log.