text
stringlengths
0
5.42k
source
stringclasses
1 value
Objects and Collections 90 Integration Capabilities using HTTP XML Collection The Collection capability has been enhanced to gather live data from HTTP/web-service delivering XML. The entire XML is automatically now converted t o TDL objects and is available natively in TDL reports as $ based methods. Reports can be shown live fr om an HTTP server. The attributes in collection for gathering XML based data from a re mote server over HTTP are Remote URL, Remote Request, XMLObject Path, and XMLObject. Dynamic Object Support When a collection is used for editing (alter/create), objects a re dynamically added to the collection when a new line is repeated over the same. The type of object w hich is added depends on the specification in the TYPE attribute. In case the TYPE attribute is not specified, it defaults to adding a standard empty object. However, the following holds true for a COLLECTION keeping in mind the latest enhancements: It can be made up of multiple types of objects (say Ledgers and Groups). It can have TDL defined objects w hich are retrieved from XML fi le. They are specified using XML Object. It can have aggregated objects. Depending solely on the TYPE attribute to make a decision, the object type is a constraint with respect to the above facts. This is now being removed with the introduction of a new attribute which will independently govern the type of object to be added to the colle ction on-the-fly. The following is now supported in a collection. NEWOBJECT : type-of-object : condition A detailed discussion on the subject can be accessed from our t raining program “TDL Enhancements for T ally. ERP 9”. Collection Capabilities for Remoting Enabling access to your organizational data 'any-time, any-wher e', and yet being truly usable, is what T ally. ERP 9 delivers. With remote access through Tally. NET Server, it will be possible for any authorized user to access T ally. ERP 9 from anywhere. Major Enhancements have taken place at the collection level to achieve remoting capabilities. The attributes Fetch, Compute and Aggr Compute provided at the Colle ction level, and Fetch Object and Fetch Collection at the Report level significantly help in a bove functionality. A detailed documentation on “Writing TDL Compliant Reports” can be downloaded from our website. Learning Outcome An object is a self-contained entity that consists of both data and procedures to manipulate the data. Objects are stored in a database. T ally data base is hierarchical in nature in which the objects are stored in a tree-like structure. Everything in TDL is an Object. Objects used for designing the User Interface are referred to a s interface objects.
TDL_Reference_Manual.pdf
Objects and Collections 91 Data is actually stored in the Data Objects. Data objects are classified into two types namely Internal objects and User defined/TDL Objects. A collection can be a collection of objects or a collection of collections. Collection, the data processing artefact of TDL provides extens ive capabilities to gather data, not only from the T ally database, but also from external sources using ODBC, DLLs and HTTP. In TDL, Object association can be done at the following levels: Report Level Association Part Level Association Line Level Association Field Level Association Each piece of information stored in a data object can be retrie ved using a method. Methods are classified as internal or external methods. Union, Filtering, Sorting and S earching are the basic capabilit ies of collection. Extraction, Aggregation, Usage As T ables, Integration Capabilit ies using HTTP XML Collection, Dynamic Object Support and Collection Capabilities for Remotin g are the advanced capabilities of collection.
TDL_Reference_Manual.pdf
TDL_Reference_Manual.pdf
93 Actions in TDL Introduction TDL is an event-driven language. Events can be triggered through a Keyboard sho rtcut or a Mouse click. In an event, some predefined actions get executed. For example: The Ctrl+A Key pressed from a voucher accepts the entry Screen. Clicking on the F1 Button from the 'Gateway of T ally' Menu resu lts in the pop up of the Company Selection Screen. Actions are activators of a specific task with a definite resul t. An action always originates from a User Interface Object like Menu, Form, Line or Field. 1. Categories of Actions Actions can be classified int o two broad categories, viz Global Actions Object Specific Actions Figure 7. 1 Action Categorization Global Actions are not specific to any User Interface Object. F or example, Display, Create, Execute, Alter, etc., are Global Actions. They perform the acti on specified, irrespective of the UI Object. Global Actions are performed on a Report or a Menu. Object Specific Actions are acti ons which can act only upon spe cific UI Objects. For example, 'Line Down' is a Part-Specific A ction, since Part owns multiple lines and an individual Line cannot move the current focus to the subsequent line. Only the Part ca n move the focus to the subsequent line. Object Specific Actions are performed on relev ant User Interface Objects.
TDL_Reference_Manual.pdf
Actions in TDL 94 Table 7. 1 Action Categorization 1. 1 Action Association Actions can be associated at various levels. Action Association at Menu Definition Action Association at 'Menu' Definition is done through the Men u Item. Every Menu Item except 'Quit' is associated with an Action. If an Item is added withou t any action, then the default action associated is to exit from the current Menu. Syntax [Menu : <Menu Name>] Add : Key Item : [Position] : <Display Item> : <Unique Key> : <Action Keyword> : <Action Parameter> Where, <Action Keyword> can be any Global Action. <Action Parameter> is decided by the Action Keyword. If the Action Keyword is 'Men u', then the Action Parameter necessarily has to be a Menu Name, else it has to be a Report Name. Example: [Menu : Commonly Used Reports] Add : Key Item : Trial Balance : T : Display : Trial Balance Add : Key Item : At Beginning : Outstandings : O : Menu : Outstandings In this example, a Menu Commonly Used Reports is defined with 2 Items, viz., 1. An Item Trial Balance is added displaying the default report 'Trial Balance'. Here, the action is display, so the Action V alue has to be a Report Name. 2. An Item 'Outstandings' is added at the beginning to activate another Menu 'Outstandings'. The action here is Menu, so the Action V alue required is a Menu Nam e. Global Actions Object Specific Actions Global Actions are not specific to any User Interface Object These Actions are specific t o a User Interface Object Can be originated by a Menu, Button/Key or a Field Can be originated by a Menu, Form, Line or a Field Performed on a Report or a Menu Performed on the relevant Inter face Object Example: Create, Display, Alter, Print, Print Report, Modify Object, Display Collection, etc. Example: Line Up, Line Down, Explode ('Line' Object), Form Accept, Form Reject ('Form' Object), etc.
TDL_Reference_Manual.pdf
Actions in TDL 95 Action Association at Button/Key Definition Action Association at Button/Key definition is done using the a ttribute Action, followed by the Action Keyword, with the parameters, if required. Syntax [Button : <Button Name>] Action : Action Keyword [: Action Parameters] Where, <Action Keyword> can be any Global or Object Specific Action. <Action Parameter> is decided by the Action Keyword. If the Action Keyword is 'Men u', then the Action Parameter necessarily has to be a Menu Name, else it has to be a Report Name. Example: Actions with Parameters [Button : Outstandings] Key : F5 Action : Menu: Outstandings [Button : Trial Balance] Key : F6 Action : Display : Trial Balance Action Menu requires a Menu Name as Parameter and Actions Create, Display, Alter, etc., require a Report Name. Example: Actions without Parameters [Button : Printing Button] Action : Print Report [Button : Exporting Button] Action : Export Report Action Parameters for the Actions Print Report and Export Report are not mandatory. If the Action Parameter is specified, then it prints the specified Rep ort, else it prints the current Report. Action Association at 'Field' Definition Action Association at Field is done using Action Keyword with p arameters and optional condition. Syntax [Field : <Field Name>] Action Keyword : <Action Parameters>[: Condition] Where, <Action Keyword> can be both Global or Object Specific Actions.
TDL_Reference_Manual.pdf
Actions in TDL 96 <Action Parameters> can be the V alue on which these Actions could be performed. <Condition> is optional. It restricts the action to be performed only if th e condition returns TRUE. Example: [Field : My Trial Balance] Display : Group : $$Is Group Display: Ledger : $$Is Ledger In this example, the Field Trial Balance has 2 statements, viz., 1. Displaying a Group, if the current object in context is a Gro up 2. Displaying a Ledger, if the current object in context is a Ledger 2. Components of Actions Any Action is always executed with respect to two contexts: Originator Executor The Originator is one that originates the Action, viz., Menu, Form, Line or Fi eld, e. g., a Down Arrow Key pressed. The event is passed from the current Report to the associated Form, Parts, Lines or Fields. Keys could be associated in Menu, Form, Line o r Field. If the activated Key is found in Form, it searches further for Line Association, and then continues till Field. The Lowest Level Key Association gets the highest precedence. If the Key i s associated at Form as well as Field, the Key Association at Field Level gets executed. In thi s case, the Field is the Originator. The Executer is one on which the action is executed. For example, 'Form Acce pt' Key, though attached at Field Level, is a Form Action. Hence, Form is the executer of the action. In case of execution, it searches from Report to the Field for the action to be executed. 'Line Down' is a Part Level Action. Though associated at the Form, it will be execute d by the Part to move the current focus to the subsequent line. Hence, Part is an executer of the Action 'Line Down'. Originator Executer The Originator initiates the action by associating the Key or a Button The Executer executes the action associated with the Key or Button, initiated by originator Global Actions can be originated by Menu, Button/ Key or a Field, and Object Specific Actions by a Menu, Form, Line or a Field Global Actions are executed by the originator object. However, Object Specific Actions can be executed by Objects other than originator
TDL_Reference_Manual.pdf
Actions in TDL 97 Table 7. 2 Components of Actions 3. Global Actions As discussed, Global Actions are Actions that are not specific to any UI Obj ect. Global Action provides an indication to the TDL Interpreter as to which speci fic task should be executed to fulfil the user requirements. Global Actions are mainly performed on t hree principal definition types, namely Report, Collection and Menu. Some frequently used Global Actions are discussed below: 3. 1 Action-Menu The Action 'Menu' acts only on the 'Menu' Definition, and vice versa. The value of the 'Menu' Action must be a Menu Name. This Menu has to be further defined to list the Items displaying another Menu or a Report. A Menu Definition continues until all the Items are used to display Reports, and there are no further Menu Actions assigned to the final Menu Items. Example: 1 ;; The following code demonstrates the usage of the Action 'Menu', along with further Menu Definitions [#Menu : Gateway of Tally] Add : Key Item : Sample Item : F : Menu : Sample Final Accounts ;; Menu Definition for the Menu to be displayed when the above Item is activated [Menu : Sample Final Accounts] Add : Key Item : Trial Balance : T : Display : Trial Balance Add : Key Item : Profit & Loss : P : Display : Profit and Loss Add : Key Item : Balance Sheet : B : Display : Balance Sheet The sequence followed to gather all Keys originating within a Report is Top to Bottom, i. e., from Report to Field definition. The lowest in the hierarchy gets highest precedence, e. g., if the same key is associated at both Form and Field definitions, the Key at Field Definition is considered for execution. The sequence followed to consume the Keys originated is from Bottom to Top, i. e., from a Field to a Report Definition. In other words, the lowest in the hierarchy gets the highest preference, e. g., if the same key is relevant for both Part and Line definitions, the Key will be executed in context of the Line Definition. Example 1 [Key: Create Ledger] Key : Alt + C Action : Create : Ledger[Field: CST Supplier Ledger] Key : Create Ledger Associating the Key with the Field, Field is the originator as well as exe-cuter here. Example 2 [Key: Part Display Pg Up] Key : Pg Up Action : Part Pg Up [System: Form Keys] Keys : Part Display Pg Up Key Part Display Pg Up is originated by Form, but its executer is the Part.
TDL_Reference_Manual.pdf
Actions in TDL 98 In this example, the Default Menu Gateway of Tally is altered t o add a new Item Sample Item, with the 'Menu' action displaying the Sample Final Accounts Sub Menu. Sub Menu Sample Final Accounts will display all components of F inal Accounts, i. e., Trial Balance Profit & Loss Balance Sheet All the Items here use the 'Dis play' Action. Hence, no further Menu Definition is required. Example: 2 ;; The following code demonstrates the usage of Menu and Display Actions and also the ;; the relevance of their association in Menu and Reports (through Form) ;; Button Definition to activate a Menu[Button : Final Accounts] Key : F5 Action : Menu : Sample Final Accounts /* Since the above Button activates a Menu, it can be acted only upon a Menu It cannot be associated to a Report */ [#Menu : Gateway of Tally] Buttons : Final Accounts ;; attaching a button to the menu [#Form : Group Summary] Buttons : Final Accounts ;; Above is an incorrect association as Buttons triggering Menu Action cannot be attached to a Form. ;; Button Definition to Display a Report [Button : Balance Sheet] Key : F6Action : Display : Balance Sheet /* Since the above Button activates a Report, it can be associated to both a Menu and a Report */ [#Form : Group Summary] Button : Balance Sheet ;; attaching a button to the report As seen in the previous Topic “Objects, Methods and Collectio ns”, the 'Display' Action takes the Report Name as its parame ter, and is used to display the Reports, as is specified.
TDL_Reference_Manual.pdf
Actions in TDL 99 [#Menu : Display Menu] Button : Balance Sheet ;; attaching a button to the menu In this example: A new Button Final Accounts is added to activate a Menu Sample Final Accounts, which is attached to the default Menu 'Gateway of T ally'. The Button Final Accounts cannot be attached to a Report, since a Menu cannot be acted upon in a Report. In the example, the Button Final Accounts is attached to Form 'Group Summary', which is incorrect since the Menu cannot be ca lled from a Report. Another Button Balance Sheet is added to display Report Balance Sheet which is enabled in all Reports, using Form Group Summary, and also in the Menu Display Menu. The Button Balance Sheet can be attached to a Report as well as to a Menu, since the Report can be acted upon by a Report as well as a Menu. 3. 2 Action-Modify Object This action alters the methods of an Object at any level in Obj ect Hierarchy. It supports modifying multiple values of an Object by specifying a comma-separated li st of Method: Value pairs. Syntax Action : Modify Object : <Primary Object Spec>. <Sub Object Path Spec>. Method Name : Value>[,Method Name : <Value>,... ] [,<Sub Object Path Spec>. Method Name :<Value>,..... ] The specifications given for <Primary Object Spec>, <Sub Object Pat h Spec>, Method Name remain the same as described in the New Method syntax section in the t opic 'Objects and Collections'. A single Modify Object Action cannot modify methods of multiple primary Objects, but c an modify multiple values of an Object. Modify Object is allowed to have Primary Object Specification o nly once, i. e., for the first value. Further values permissible are optional in the Sub Object and M ethod Specification only. From second value onwards, Sub Object specification is optional. If Sub Object Specification is specified, the context is assumed to be the Primary Object spec ified for first value. In absence of sub object specification, the previous value specification's leaf object is considered a s the context. Example: 1 [Key : Alter My Object] Key : Ctrl + Z Action : Modify Object : (Ledger,"My Ledger"). Bill Allocations + [First, $Name="My Bill"]. Opening Balance : 100,+ Address[Last]. Address : "Bangalore" The existing ledger My Ledger is being altered with new values for the Opening Balance for the existing bill and Address. The key Alter My Object can be attached to any Menu or Form.
TDL_Reference_Manual.pdf
Actions in TDL 100 Example: 2 [Key : Alter My Object] Key : Ctrl + Z Action : Modify Object :(Ledger,"My Ledger"). Bill Allocations[1] + . Opening Balance:1000,Name: ”My New Bill”,..Address[First]+ . Address :"Hongasandra Bangalore", Opening Balance:5000 The existing ledger My Ledger is being altered with new values for the Opening Balance applicable on the existing bill, Opening Balance of the ledger and the first line of the Address. The key Alter My Object can be attached to any Menu or Form. A button bearing the action 'Modify Object', if associated at M enu Definition, requires a primary object specification as Menu, which is not in context of any Da ta Object. Example: [#Menu : Gateway of Tally] Add : Button : Alter My Object The following points should be considered while associating a k ey with the action Modify Object: Since the Menu does not have any Info Objects in context, speci fying Primary Object becomes mandatory. Since Menu cannot work on scopes like Selected, Unselected, etc., the scopes specified are ignored. Any formula specified in the value and evaluated, assumes Menu Object as requestor. Even Method values pertaining to Company Objects can be modifie d. A button can be added in the Menu to specify the action Modify Object at the Menu level. 3. 3 Action-Browse URL The Action 'Browse URL' is used to provide a link to any web br owser, with a URL formula passed as a parameter. Syntax Action : Browse URL : <URL Formula> Example: Field acting as a hyperlink [Key : Execute Hyperlink] Key : Left Click Action : Browse URL : “www. tallysolutions. com” [Field : Hyperlink Company] Color : Blue Border : Thin Bottom
TDL_Reference_Manual.pdf
Actions in TDL 10 1 Key : Execute Hyperlink Set as : "Tally Solutions Pvt. Ltd" Local : Key : Execute Hyperlink : Action : Browse URL: + http://www. tally. co. in 3. 4 Actions-Create and Alter 'Create' and 'Alter' Actions act only upon the 'Report' Definit ion. These actions activate the Report in 'Create' or 'Alter' Mode. In other words, the Report is started in the Edit Mode. In cas e of 'Create' Action, the user enters the Report in order to add val ues, whereas in case of 'Alter', the user enters the Report to modify the already created values. These actions help the user to key in the relevant values. The values thus entered may or may not be stored. The treatment of values depends on need. The values thus entered in the Report by the user, if required to be retained, can be stored as a part of T ally D atabase or Configuration File. As discussed in the T opic on V ariables, all the persistent vari able values can be stored in a Configuration File T allysav. TSF for subsequent sessions. The values entered in the Report can also be stored as a part o f the T ally Database T o store the values as a part of T ally Database, the Report mus t be associated to a Data Object. For example, Group, Ledger, Voucher, etc., are some of the Data Objects available in T ally. For instance, in order to design an interface to create a Ledge r: The Object 'Ledger' must be associated to the Report using Repo rt Attribute 'Object' V alues entered by the user in the Fields within the Report must be stored in relevant Methods using Field Attribute 'Storage' Example: /* The following code demonstrates the usage of Action 'Create' and Attribute 'Storage' at Field Definition to store the values entered within the relev ant Object associated at Report Level*/ [#Menu : Gateway of Tally] Add : Key Item : Ledger Creation : L : Create : Create Ledger [Report : Create Ledger] Form : Create Ledger Object: Ledger ;; Object Association done at Report Level [Form : Create Ledger] Parts : Create Ledger [Part : Create Ledger] Lines : Store Ledger Name, Store Ledger Group [Line : Store Ledger Name]
TDL_Reference_Manual.pdf
Actions in TDL 102 Fields : Short Prompt, Name Field Local : Field : Short Prompt : Info : "Name :" Local : Field : Name Field : Storage : Name /* Storing value entered by user in Internal Method Name available within Object associated at Report*/ [Line : Store Ledger Group] Fields : Short Prompt, Name Field Local : Field : Short Prompt : Info : "Under :"Local : Field : Name Field : Storage : Parent Local : Field : Name Field : Table : Group /* Similarly, Parent Method is stored with the user entered value which is cons idered as the Group of the Ledger created. Also Group is a defa ult Table/Collection to display all the default as well as the user defined Groups. Field Attribute Table helps to restrict the user input to a predefined list*/. In this example: The Default Menu Gateway of T ally has been altered to add a new Item 'Ledger Creation', which allows the user to create a Ledger. Report Create Ledger associates the Object 'Ledger' to it, which indicates that the Report is meant for creating an instance of the Object 'Ledger'. Name and Group of the Ledger are stored in Internal Methods Nam e and Parent. Example: ;; The following code demonstrates the usage of 'Alter' Action at Button [Button : My Reco Button] ;; Button meant to do Bank Reconciliation Key : Alt + F5 Action : Alter : Bank Recon ;; 'Alter' Action to trigger Ba nk Recon Report in 'Alter' Mode Title : “Reconcile” ;; Associating the Button to the Report [Form : My Bank Vouchers] Button : My Reco Button In this example: Button My Reco Button is defined with 'Alter' action to alter the Report Bank Recon on pressing the Alt + F5 Key. It is used for entering dates in the Bank Reconciliation Repor t. The Button My Reco Button is associated to the Form My Bank V oucher
TDL_Reference_Manual.pdf
Actions in TDL 10 3 Example: ;; The following code demonstrates th e usage of Alter Action at Field [#Menu : Gateway of Tally] Add : Key Item : Ledger Display : L : Display : My Ledger [Report : My Ledger] Form : My Ledger [Form : My Ledger] Parts : My Ledger Height : 100% Page Width : 100% Page[Part : My Ledger] Lines : My Ledger Repeat : My Ledger: Ledger ;; Ledger is a default collection of Ledger Objects Scroll : Vertical [Line : My Ledger] Fields : My Ledger Key : Line Object Enter Alter, Line Click Object Enter Alter ;;The above default Keys act upon 'Line' Definition and the action 'Alter Object' is associated with the Keys, provided the current Repo rt is in 'Display' Mode [Field : My Ledger] Set As : $Name Variable : Ledger Name ;;Variable 'Ledger Name' retains the Ledger selected by the user for the subsequent report Alter : Create Ledger ;; 'Alter' Action is used to ac tivate the Report in 'Alter' Mode ;; 'Create Ledger' is a user defined Report defined while Ledger Creation In the example mentioned above: Two default Keys are associated to a 'Line' Definition, that al lows a selection of any of the lines, from the set of repeated lines. Action associated with these Keys is 'Alter Object', which mean s that on hitting the Key, the Object associated with the current Line must be altered. Mode: Display specified in the Keys signifies that current repo rt must be in Display Mode. 'Alter' Action used at the 'Field' definition prompts the repor t from being activated on the current field, which must be in 'Alter' Mode.
TDL_Reference_Manual.pdf
Actions in TDL 104 3. 5 Actions-Create Collection, Display Collection an d Alter Collection Action-Create Collection A Menu Item can be used to create Objects in a Collection with the action 'Create Collection'. This action is generally used for creat ion of Masters such as Groups, Ledgers, Stock Items, Voucher Types, etc. 'Create Collection' fetches a report through the de fined Collection. A report displayed through this action, is displayed in 'Create' mode. Example: ;; The following code demonstrates th e usage of 'Create Collection' Action [#Menu : Gateway of Tally] Add : Key Item : Ledger : L : Create Collection : Ledger ;; where a Ledger is a predefined Collection in Def TDL One can also use the action 'Create' in place of 'Create Collec tion', to create Objects in a collection. The only difference is that 'Create' explicitly cal ls a Report and 'Create Collection' requires a collection. 'Create Collection' executes the same report throug h the defined Collection. Action-Display Collection A Menu Item or a Button can be used to display a popup of Objec t names in a Collection, which in turn, can trigger a Report. On choosing an Object from the popu p, a report in Display mode is triggered by the action 'Display Collection'. This action can b e used for displaying the Masters or Reports pertaining to Groups, Ledgers, Stock Items, etc. Example: ;; The following code demons trates the usage of 'Dis play Collection' Action [#Menu : Gateway of Tally] Add : Key Item : Ledger : L : Display Collection : Ledger ;; where Ledger is a predefined Collection in Def TDL. Though the Action name is 'Display Collection', 'Display' is me ant for the subsequent Report, which will be displayed on selection of an Object. Here, the Re port is in 'Display' mode. Action-Alter Collection The Action 'Alter Collection' is similar to 'Display Collection ', but it triggers the Report in 'Alter' mode. This Action is generally used to alter the Masters such a s Groups, Ledgers, Stock Items, Voucher Types, etc. Example: ;; The following code demonstrates the usage of 'Alter Collection' Action [#Menu : Gateway of Tally] Add : Key Item : Ledger : L : Alter Collection : Ledger ;; where Ledger is a predefined Collection in Def TDL Though the Action is 'Alter Collection', 'Alter' is meant for t he subsequent Report, which will be displayed on the selection of an Object.
TDL_Reference_Manual.pdf
Actions in TDL 10 5 'Display Collection', 'Create Collection' and 'Alter Collection ' routes the final report through a Collection. Let us understand some critical Attributes required to achieve these actions. Collection Attributes-Trigger, Variable and Report The Collection attributes 'Trigger', 'V ariable' and 'Report' su pport the actions 'Create Collection', 'Display Collection' and 'Alter Collection', respectively. [Collection : My Ledger] Type : Ledger Trigger : Led List Select Report : Selected Ledger Display Variable : Ledger Name Attribute-Trigger The Collection attribute 'Trigger' is used to popup the Object names from a Collection. For example, a List of Items pop up w hen you choose the default Men u Item 'Stock Item'. Syntax [Collection : <Collection Name>] Trigger : <Report Name> <Report Name> is the Interface used to display the Object names in a Collecti on. Attribute-Report The Collection Attribute 'Report' displays a Report based on th e Object selected. For example, Item Monthly Summary is a default Report being displayed when you choose a particula r stock item. Syntax [Collection : <Collection Name>] Report : <Report Name> where, <Report Name> is the final report displayed, when an Object is selected from the Collection. Attribute-Variable The Collection Attribute 'V ariable' stores the name of the sele cted Object. This attribute is used with actions, Display Collection and Alter Collection. Syntax [Collection : <Collection Name>] Variable : <Variable Name> where, <Variable Name> is the variable storing the Object name for the subsequent Repo rt to be displayed.
TDL_Reference_Manual.pdf
Actions in TDL 106 Example: [Collection : Stock Items in Display Collection] Type : Stock Item Trigger : Stock Item Selection Interface Report : Stock Item Final Report Variable : Stock Item Name 4. Object Specific Actions Some of the Object Specific Actions are discussed in this secti on: 4. 1 Menu Actions-Menu Up, Menu Down, Menu Reject Actions 'Menu Up', 'Menu Down', 'Menu Reject', etc., act upon M enu. They are associated to all Menus (Default as well as User Defined TDL) through the declara tion [System: Menu Keys] Example: [Key : Menu Up] Key : Up Action : Menu Up [Key : Menu Down] Key : Down Action : Menu Down [Key : Menu Reject] Key : Esc Action : Menu Reject [System : Menu Keys] Key : Menu Down, Menu Up, Menu Reject [System: Menu Keys] declares a list of Keys commonly required for a Menu. Since all common menu operations like Scroll Up, Scroll Down, Drill down, etc., are declared here, a new Menu added does not require these keys to be associated, as they are inherited from above declaration. 4. 2 Form Actions-Form Accept, Form Reject, Form End Actions 'Form Accept', 'Form Reject', 'Form End', etc., act upo n Form. They are associated to all Forms (Default as well as User Defined TDL) through the declara tion [System: Form Keys]. Action Form Accept saves the current Form. Action Form Reject rejects the current Form, i. e., the current form is quit withou t saving.
TDL_Reference_Manual.pdf
Actions in TDL 10 7 Example: [Key : Form Accept] Key : Ctrl + A Action : Form Accept Mode : Edit [Key : Form Display Reject] Key : Esc Action : Form Reject Mode : Display [Key : Form End] Key : Ctrl + End Action : Form End [System : Form Keys] Key : Form Accept, Form Display Reject, Form End [System: Form Keys] declares a list of Keys commonly required f or a Report. Since all common Form operations like Save Form, Reject Form, Form End, etc., ar e declared here, a new Form added does not require these keys to be associated, as they are inherited from above declaration. 4. 3 Part Actions-Part Home, Part End, Part Pg Up The Actions 'Part Home', 'Part End', 'Part Pg Up', etc., act up on a Part. These keys are associated with all the Forms (Default TDL codes as well as Use r Defined TDL codes) through the declaration [System: Form Keys]. Action Part Home positions the cursor to the beginning of the current Part. Action Part End positions the cursor to the end of the current Part. Action Part Pg Up is used to quickly scroll the page to view the previous page. Example: [Key : Part Display Home] Key : Home Action : Part Home Mode : Display [Key : Part Display End] Key : End
TDL_Reference_Manual.pdf
Actions in TDL 108 Action : Part End Mode : Display [Key : Part Display Pg Up] Key : Pg Up Action : Part Pg Up Mode : Display [System : Form Keys] Key : Part Display Home, Part Display End, Part Display Pg Up [System: Form Keys] declares a list of Keys commonly required for a Part. Since all common Part operations like Part Home, Part End, Part Pg Up, etc., are declared here, a new Part added does not require these keys to be associated, since they are in herited from the above declaration. 4. 4 Line Actions-Explode, Display Object, Alter Object Line Actions-Explode, Display Object, Alter Object, etc., act upon a Line. Action Explode explodes a line further to disp lay all the explode details spec ified in the Line Attribute 'Explode'. Action Display Object is used to display the Object in context of the current line. Action Alter Object is used to alter the Object in context of the current line. Example: [Key : Line Explode] Key : Shift + Enter Action : Explode [Key : Line Object Display] Key : Enter Action : Display Object Mode : Display [Key : Line Object Alter] Key : Ctrl + Enter Action : Alter Object Mode : Display [System : Form Keys]
TDL_Reference_Manual.pdf
Actions in TDL 10 9 Key : Line Explode Key : Line Object Display, Line Object Alter [System: Form Keys] declares a list of Keys commonly required for a Line. Since all common Line operations like Explode, Display Object, Alter Object, etc., are declared here, a new Line added does not require these keys to be associated, as they are inherited from above declaration. 4. 5 Field Actio ns-Field Copy, Field Paste, Field Erase, Calculator The Actions 'Field Copy', 'Field Paste', 'Field Erase', 'Calcul ator', etc., act on Fields. Action Field Copy copies the current field (Field where the cursor is positioned) contents in the OS clipboard, which will be available later. Action Field Paste pastes the clipboard contents to the current Field. Action Field Erase is used to erase the contents of the current Field at a stretch, without hitting the Backspace or Delete Key. Action Calculator is used for Fields that require some computation, the result of which is to be returned to the Field. Fields taking Amounts / Numbers as va lue require this action. Example: [Key : Field Copy] Key : Ctrl + Alt + CAction : Field Copy [Key : Field Paste] Key : Ctrl + Alt + VAction : Field Paste [Key : Field Erase] Key : Esc Action : Field Erase Mode : Edit [Key : Calculator] Key : Alt + CAction : Calculator Mode : Edit [Field : Num Decimals Field] Key : Calculator [System : Form Keys]
TDL_Reference_Manual.pdf
Actions in TDL 110 Key : Field Erase Key : Field Copy, Field Paste [System: Form Keys] declares a list of Keys that are commonly required for any Fiel d. Since all the common Field operations like 'Field Copy', 'Field Paste', ' Field Erase', etc., are declared here, a new Field added does not require these keys to be associated, s ince they are inherited from the above declaration. The Action 'Calculator' is not required for all the Fields; he nce, it has not been declared in Form Keys usage List. It has been associated to the Fields where it is required. In the above example, 'Num Decimals Field' is a numeric field which may require calculations. Therefore, the 'Calculator' Key, associating the Action Calculator, is attached to the Field. Learning Outcome Actions are activators of a specific task with a definite resul t. An Action always originates from User Interface (UI) Objects Menu, Form, Line or Field. Global Actions and Object Specific Actions are the different ty pes of actions used in TDL. Actions can be associated at various levels: Action Association at Menu Definition Action Association at Button/Key Definition Action Association at Field Definition An Action is always executed with respect to two contexts: Originator Executer Some of the frequently used Global Actions are: Menu Modify object Browse URL Create and Alter Some of the Object Specific Actions are: Menu Actions-Menu Up, Menu Down, Menu Reject Form Actions-Form Accept, Form Reject, Form End Part Actions-Part Home, Part End, Part Pg Up Line Actions-Explode, Display Object, Alter Object Field Actions-Field Copy, Field Paste, Field Erase, Calculator
TDL_Reference_Manual.pdf
111 User Defined Fields Introduction In T ally. ERP 9, the structure of an object, the data type and s torages required in order to store the data are all pre-defined by the platform. All the data is store d in the T ally database. By default, data is always stored in pre-defined storages only. There may be instances when additional information needs to be stored in the existing objects. This need gave rise to concept of User Defined Fields (UDF). A UDF can be used to store additional information to the T ally database. In other words, UDFs store additional information into the existing objects. 1. What is UDF? User Defined Fields have a storage component defined by the use r. UDFs are stored in the current object context. They can be of any T ally data type such as String, Amount, Quantity, Rate, Number, Date, Rate of Exchange and Logical. Defining UDFs does not serve the purpose, unless it is associat ed with one or more internal object. When a UDF is created and used in an already existing r eport, the data is stored in the context of the object, i. e., it is always associated to the object to which the report i s associated, i. e., the object in context. 1. 1 Creating a UDF UDFs should be defined under the section [System: UDF]. Syntax [System : UDF] <Name of UDF> : <Data Type> : <Index Number> Where, <Name of UDF> Identifies the UDF. Ideally, it should describe the purpose for which it has been created. <Data Type> is any of the T ally data types or 'Aggregate'. <Index Number> can be any number between 1 and 65536. Numbers falling between 1 to 9999 and 20 001 to 65536 are opened for customisation, and those between 10000 to 20000 are allotted for Common development in T SPL. The user can create 65536 UDFs of each data type. The index numbers 1 to 29 are already used for Default TDL.
TDL_Reference_Manual.pdf
User Defined Fields 112 Example : [System : UDF] My UDF 1 : String : 20003 My UDF 2 : Date: 20003 The advantage of UDF in T ally is that it automatically attaches with the current object. No specific declaration is required for object association, when the UDF is defined within system definition. 1. 2 Storing User Inputs in the UDF The attribute Storage is used to store the value entered in the field, in the current object context. Syntax Storage : <Default Storage/Name of UDF> Where, <Name of UDF> identifies the UDF. Ideally, it should describe the purpose for which it is created. Example : [Field : New Field] Use : Name Field Storage : My UDF 1. 3 Retrieving the value of UDF from an Object In the context of the current object, the value of a UDF can be accessed by prefixing $ to the UDF name. Syntax $<Name of UDF> Example : [Field: New Field] Use : Name Field Set As : $My UDF 2. Classification of UDF's The UDFs are classified into two types, which are as follows: Simple UDF Complex/Compound/Aggregate UDF 2. 1 Simple UDF It can store one or more values of a single data type. A UDF us ed for storage, stores the values in the context of the object associated at Line/Report level, by d efault. Only one value is stored in this case.
TDL_Reference_Manual.pdf
User Defined Fields 11 3 UDF to store a single value The following example code snippet demonstrates how a UDF can b e made use of to store a single value: Example : [Report : Company Vehicles] Object : Company... [Field : CVeh] Use : Name Field Storage : Vehicle Unique : Yes [System : UDF] Vehicle : String : 700 The object is associated at the Report Level. The value stored i n a U D F i s i n t h e c o n t e x t o f 'Company' Object in this case. The UDF 'Vehicle' stores a singl e string value. UDF to store multiple values When multiple values of the same data type are to be stored, th en the 'Repeat' attribute of Part is used. The field of the line uses the same UDF name in the 'Stor age' attribute. Syntax Repeat : <Line name > : < Name of UDF > Where, <Line Name > is the name of the line to be repeated. <Name of UDF> identifies the name of the UDF to store multiple values The example in the section “UDF to store single value” can be m odified to store multiple values. Example : [Part : Comp Veh] Line : Comp Veh Repeat : Comp Veh : Vehicle Break On : $$Is Empty : $Vehicle Scroll : Vertical
TDL_Reference_Manual.pdf
User Defined Fields 114 In this scenario, multiple values of type Stri ng can be stored under the object Company. Creating collection of Values Stored in UDF Multiple values stored in a UDF can be displayed as T able in a field. The Collection is defined as: Syntax [Collection : <Collection Name>] Type : <UDF Name> : <Object Name> Format : $<UDF Name>, 20 Example : [Collection : CMP Vehicles] Type : Vehicle : Company Childof : ##SVCurrent Company Format : $Vehicle, 20Title : "Company Vehicles" It creates a collection of values stored in the UDF of the curr ent object 'Company'. This collection can be used in the 'T able' attribute of 'Field' definition. Whe n the cursor is in the defined field, the values stored in the UDF will be displayed as a popup table. Consider the following example: [Field : EI Vehicles Det] Use : Short Name Field Table : CMP Vehicles, Not Applicable Show Table : Always A popup table is displayed when the cursor is placed in the fie ld 'EI Vehicles Det'. The T able contains values stored in the UDF which are Not Applicable as a list. 2. 2 Aggregate UDF A Simple UDF can only store values of a single data type; so, w hen multiple values of different data types are required to be stored as one entity, an Aggregate UDF can be used. Aggregate UDFs are very useful for storing multiple values and repeated values. An aggregate UDF is a combination of different types of UDFs. Aggregate UDFs can be used to store user data in a tabular format, attached to any internal object, and can b e used as a collection of UDFs. In other words, an Aggregate UDF comprises of a set of fields r epeating more than once. The output can be stated in the form of a record consisting of fiel ds of different types and sizes. When a line is repeated over an Aggregate UDF, it associates all its storage components (same or different data types) as a single unit. Creating an Aggregate UDF
TDL_Reference_Manual.pdf
User Defined Fields 11 5 T o create an Aggregate UDF, the data type 'Aggregate' is used while defining the UDF. The components are defined as simple UDFs. Syntax [System : UDF] <Name of UDF> : Aggregate : <Index Number> Example : A Company wants to create and store multiple details of company vehicles. The details required are: Vehicle Number, Brand, Y ear of Mfg., Purchase Cost, Type of Vehicle, Currently in Service, Sold On date and Sold for Amount. [System : UDF] Company Vehicles : Aggregate : 1000 VVehicle Number : String : 1000VBrand : String : 1001 VYear of Mfg : Number : 1000 VPurchase Cost : Amount : 1000 VType of Vehicle : String : 1002 VCurrently in Service : Logical : 1000 VSold On date : Date : 1000VSold for : Amount : 1001 T o store the required details, simple UDFs are defined and to s tore them as one entity, a UDF of type 'Aggregate' is defined, as shown in the example. Using an Aggregate UDF An Aggregate UDF defined does not associate each component fiel d with it. The association will takes place only when a Line is repeated over an Aggregate UDF and within that Line, there are fields which store the value into the component UDFs. Syntax Repeat : <Line name> : <Name of Aggregate UDF> Where, <Name of Aggregate UDF> is the name of the UDF defined with 'Aggregate' data type. Example : [Part : Comp Vehicle] Line : Comp Veh Ln Repeat : Comp Veh Ln : Company Vehicles
TDL_Reference_Manual.pdf
User Defined Fields 116 Break On : $$Is Empty : $VBrand... [Field : CMP VBrand] Use : Short Name Field Storage : VBrand The Line is repeated over the Aggregate UDF and the Simple UDFs are entered in the fields. Using Aggregate UDF in a Sub-Form 'Subform ' is an attribute that is used within a Field definition. It re lates to a report (not Form) and can be invoked by a field. This attribute is useful to activate a report within a report, perform the necessary action and return to the report used to invoke the Su bform. There is no limit on the number of Subforms that can be used at the field level. Syntax [Field : Field Name] Sub Form : <Report Name> : <Condition> Where, <Report Name> is the name of the Report to be displayed. <Condition> could be any expression, which evaluates to a logical value. Th e report will be displayed only when the condition is True. A Sub Form is not associated to the Object at the Report level. An Object associated to the Field in which the Sub Form is defined, gets associated to the Sub Fo rm. A Sub Form will inherit the info object from the Field which appears as a pop-up. The Bill-wise Details is an example of a Subform attri bute. This screen is displayed as soon as an amount is entered for a ledger whose Bill-wise Details featu re has been activated. Example : The following code snippet uses a Subform to enter the details of bills when the Bill Collection ledger is selected, while entering a Voucher. The values entered in the Subform are stored in an Aggregate UDF. This UDF is attached to the object to which the field displayi ng the Subform is associated. Here, it is the Object of a Ledger Entries Collecti on. The following code is used to associate a Subform to the defaul t Field in a voucher. [#Field : ACLSLed] Sub Form : Bill Detail : ##SVVoucher Type = "Receipt"+ and $Ledger Name = "Bill Collection"
TDL_Reference_Manual.pdf
User Defined Fields 11 7 The Name Report for the Subform uses an Aggregate UDF to store the data. A Line is repeated over the Aggregate UDF at the Part level. [Part : Bill Details] Scroll : vertical Line : Bill Details H, Bill Details DRepeat : Bill Details D : BAggre Break After : $$Line=2 The Attibute Storage is used for all the fields. [Field : Cust Name1] Use : Name Field Storage : Cust Name The UDF is defined as follows: [System : UDF] Cust Name : String : 1000 Bill No : String : 1001 Bill Amt : Amount : 1001EPrint1 : String : 1002 BAggre : Aggregate : 1000 Learning Outcome UDFs are stored in the context of the current Object. They can be of any T ally data type. UDFs should be defined under the section [System: UDF]. The attribute 'Storage' in a Fiel d definition is used to store the value entered in a Field. The value is stored in the context of the current Object. A Simple UDF can store one or more values of a single data type only. Aggregate UDFs are very useful for storing multiple values and repeated values. Currently, UDF values can be retained only if the sub-objects are stored as is. However, in sub-objects where the accepted expense ledger information is appor-tioned against inventory, they are not stored independently but are attributed to the item cost once the object is accepted. Fo r example, in purchase or manufacturing journal vouchers, the additional cost tabl e is not retained independently within the object and is apportioned against the item cost while accepting the voucher. Hence, the UDF cannot be added and retained in these sub-objects.
TDL_Reference_Manual.pdf
TDL_Reference_Manual.pdf
119 Reports, Printing and Validation Controls Introduction In previous lesson, the significance and usage of User Defined Fields was explaine d. The classification and creation of UDFs was also discussed. This lesson is dedicated to Report creation and printing. The types of reports and the different ways of printing them w ill be explained in detail. 1. Reports In T ally. ERP 9, financial statements are generated as Reports, based on the vo uchers entered till date. Balance Sheet, Profit & Loss A/c, Trial Balance, etc., are som e default Reports in T ally. Normally, a business requires Reports in any of the following formats: T abular Report: A Report with fixed number columns, which can b e configured. Hierarchical Report: A Report designed in successive levels or layers. Column-Based Reports: A Report with multiple columns. T ally. ERP 9 caters to generating all these types of Reports. 1. 1 T abular Reports They have the simplest format of all the Report formats. A typical T abular report has the following components: Report Title : It contains the Name of the Report, the Title for each column, the Day/Period for which a Report is generated, etc. Report Details : It contains the actual information. Report T otal : It contains the T otal of the respective columns. A typical T abular Report has a fixed number of columns and is i nteractive, i. e., an end user can change its appearance. Day Book, Stock Summary, Trial Balance, Group Summary, e t c., a r e some default T abular Reports in T ally. The T abular Report 'Stock Summary' is shown in Fig. 9. 1 Designing a T abular Report A typical T abular Report will have a Title Line, a Details Line, and an optional T otal Line. The Details Line will be repeated over the objects of a Collection. A T abular Report can be made Interactive by adding the followin g features: Adding Buttons to change the period, to change the contents of the Report, etc. (As discussed in lesson 5: V ariables, Buttons, Keys) Adding explosions to the lines
TDL_Reference_Manual.pdf
Reports, Printing and Validation 120 Figure 9. 1 S tock Summary Displaying the Exploded Part T ally. ERP 9 allows the user to display additional information a bout the current line object, when the key combination SHIFT + Enter is pressed. This functionality is called as 'explosion' in T all y. Line attributes Explode and Indent, and the function $$Key Explode, are used for the same. Attribute-Explode The attribute 'Explode' refers to an attribute of the line, whi ch is used to take the current data from the Line Object. A Part is displayed after the process of explo sion is complete. Syntax Explode : <Part Name> : <Logical Condition> Where, <Part Name> is the name of the Part which displays additional information a bout the Line object. <Condition> if True, will result in an explosion. Function-$$Key Explode $$Key Explode function gives the current status of the keys Shif t and Enter. This is used as a condition to check if the user has pressed the Shift+Enter Key combination.
TDL_Reference_Manual.pdf
Reports, Printing and Validation 12 1 Example 1: Simple T abular Report Let us consider writing a simple Trial Balance. [Part : My TB Part] Lines : My TB Title, My TB Details Repeat : My TB Details : My TB Groups Scroll : Vertical Figure 9. 2 Simple Tr ial Balance Report Example 2: A Simple Interactive T abular Report A report showing all the Primary groups can be created and expl oded by pressing Shift + Enter to view the sub groups. The ledgers can subsequently be viewed on the same screen with an indent for each level. The report is as shown in Figure 9. 3 The following code snippet displays the exploded part: [Line : My TB Details] Fields : My TB Name Field, My TB Par Name Field Right Fields : My TB Dr Amt Field, My TB Cr Amt Field Explode : My TB Group Explosion : $$Is Group and $$Key Explode [Field : My TB Name Field]
TDL_Reference_Manual.pdf
Reports, Printing and Validation 122 Use : Name Field Set as : $Name Variable : My Group Name1 Figure 9. 3 Simple Inter active Tabular Report The code for the exploded part is as follows: [Part : My TB Group Explosion] Lines : My TB Details Explosion Repeat : My TB Details Explosion: My TB Groups Ledgers Scroll : Vertical [Line : My TB Details Explosion] Fields : My TB Name Field, My TB Par Name Field Right Fields : My TB Dr Amt Field, My TB Cr Amt Field Explode : My TB Group Explosion : $$Is Group and $$Key Explode Indent : 2* $$Explode Level Local : Field : Default : Delete : Border
TDL_Reference_Manual.pdf
Reports, Printing and Validation 12 3 The Collection My TB Group Ledgers is a union of collections of Type 'Group' and 'Ledger', respectively. [Collection : My TB Groups Ledgers] Collection : My TB Groups, My TB Ledgers The V ariable Mygroup Name1 is used in Child Of attribute, under the collections 'My TB Groups' and 'My TB Ledgers'. [Collection : My TB Groups] Type : Group Child Of : #My Group Name1 [Collection : My TB Ledgers] Type : Ledger Child Of : #My Group Name1 When the user presses the Shift + Enter keys, then the exploded part shows the Sub-groups under the group in the current line, as shown in Figure 9. 4. Figure 9. 4 Interac tive Tabular Report When the keys Shift + Enter are pressed by the user, one more exploded part shows the Ledgers under the current Sub-group, as shown in Figure 9. 5.
TDL_Reference_Manual.pdf
Reports, Printing and Validation 124 Figure 9. 5 Interactive T abular Reports-Sub Groups 1. 2 Hierarchical Repor t (Drill down Report) A T ally application provides a simple way of navigating from on e report to another, w h i c h i s commonly referred to as a drill down. A Drill Down facility mov es from one report to the other to give a detailed view based on the selection in the current repo rt. A user can return to the first Report from the detailed view. A typical drill down in T ally. ERP 9 starts from the Report and reaches the Voucher Alteration screen. Designing Hierarchical Reports Hierarchical Reports can be designed by incorporating the follo wing changes to a T abular Report: Variable attribute of Report definition Child Of attribute of Collection definition Display and Variable attributes of Field definitions Variable Definition Example : The following code snippet demonstrates the Drill down action, which is based on the Group Name displayed in the field. The Drill down action is achieved by specifying the two attributes 'V ariable' and 'Display' at the field level. [Field : My TB Name] Width : 120 mms Set as : $Name
TDL_Reference_Manual.pdf
Reports, Printing and Validation 12 5 Variable : Group Var Display : My Trial Balance : $$Is Group A V ariable is defined as 'Volatile' and is associated at Report. The attribute 'V ariable' of Report definition is used to associate the V ariable with the report. [Variable : Group Var] Type : String Default : "" Volatile : Yes [Report : My Trial Balance] Form : My Trial Balance Variable : Group Var The same V ariable is used in the 'Childof' attribute of the 'Co llection' definition. When a line is repeated over this collection in the report; when the user pres ses the Enter key, the Report being displayed will have the objects whose Parent Name is stored in the variable. [Collection : My Collection] Type : Group Childof : ## Group Var
TDL_Reference_Manual.pdf
Reports, Printing and Validation 126 The following screen is displayed when the user selects the opt ion from the Menu: Figure 9. 6 Trial Balance Report When the key Enter is pressed by the user, the next screen displays the Sub Groups of the current Group as shown in Figure 9. 7
TDL_Reference_Manual.pdf
Reports, Printing and Validation 12 7 Figure 9. 7 Trial Balance-Sub group 1. 3 Column Based Reports The reports in which the number of columns added or deleted as per the user inputs are referred to as column-based reports. There are four types of column-base d reports in T ally, namely Multi-Column Reports, Auto-Column Reports, Automatic Auto-Colum n Reports and Columnar Reports. All these types are explained with examples in this section. Multi-Column Reports In Multi-Column reports, a column is repeated based on the criteria specified by user. T r i a l Balance, Balance Sheet, S tock Summary, etc., are some default Reports in T ally. ERP 9 having Multi column feature. Normally, this feature is used to compare values across different period s. Designing a Multi Column Report In a T abular Report, Lines are repeated over a collection. But in a multi-column Report, columns are repeated in addition to the repetition of the Lines over a Collection. Based on the user input, columns are repeated. The column Report is used to capture user inputs like Period, Company Name, Stock V aluation, etc., based on which columns are generated. Following attributes are used at various components of a Report to incorporate the multi-column feature: Attribute-Column Report Attribute 'Column Report' of the 'Report' definition, facilitat es the creation of multi-column reports.
TDL_Reference_Manual.pdf
Reports, Printing and Validation 128 Syntax Column Report : <Report Name> Where, <Report Name> is the name of the report used to obtain user inputs from the o ptions displayed. Attribute-Repeat Attribute 'Column Report' is associated with a variable, which in turn is specified in 'Repeat' attribute of 'Report' definition. Both attributes are specified in 'Report' definition to create a multi-column report. Syntax Repeat : Variable Example: Incorporating Multi Column Feature to Trial Balance re port Step 1 : Using Column Report & Repeat attribute at the Report By using the 'Column Report' & 'Repeat' attributes at the Repor t, “New Column ”, “Alter Column ” and “ Delete Column ” buttons will be automatically a dded to 'Mul Col Trial Balance' Report. [Report : Mul Col Trial Balance] Column Report : My Multi Columns Repeat : SVCurrent Company, SVFrom Date, SVTo Date
TDL_Reference_Manual.pdf
Reports, Printing and Validation 12 9 Figure 9. 8 Multi Column Report Step 2: Modifying the System Variables in a multi-column Report By clicking New Column button, 'My Multi Columns' Report is displayed. In this Report, t he user inputs are captured, which will be reflected in the System V ari ables. [Field : My Multi From Date] Use : Uni Date Field Modifies : SVFrom Date [Field : My Multi To Date] Use : Uni Date Field Modifies : SVTo Date [Field : My Multi Company] Use : Name Field Modifies : SVCurrent Company Table : Company
TDL_Reference_Manual.pdf
Reports, Printing and Validation 130 Figure 9. 9 Column Details for Multi Column Report Step 3: Repeating Columns over a Variable and Lines over Objects of a C ollection T o repeat columns over a V ariable, which is captured in 'My Multi Columns' Report, following needs to be done at various components of the 'Mul Col Trial Balance' Report. 1. Report Definition: Repeating over the values of system variable which is captured in My Multi Columns Report [Report : Mul Col Trial Balance] Repeat : SVCurrent Company, SVFrom Date, SVTo Date 2. Part Definition: Repeating Lines over objects of a Collection. [Part : Mul Col TB Details] Lines : Mul Col TB Details Bottom Lines : Mul Col TB Total Repeat : Mul Col TB Details : Mul Col TB Group Led
TDL_Reference_Manual.pdf
Reports, Printing and Validation 13 1 3. Line Definition:-Repeating Field [Line : Mul Col TB Details] Fields : Mul Col TB Name Field, Mul Col TB Amount Field Repeat : Mul Col TB Amount Field Figure 9. 10 Multi Column Report Auto-Column Report An Auto column report is one in which multiple columns are repe ated by just one click of a button. Trial Balance, Balance Sheet, Stock Summary, etc., are some of the default Reports in T ally. ERP 9 which have an Auto column feature. Designing an Auto-Column Report Auto column Report is similar to a Multi column Report, except that here, a set of columns are repeated, instead of one. User input will decide the criteria o n which the columns are repeated. Example: Incorporating Auto Column Feature to Trial Balance rep ort Step 1: Adding the Configuration Screen to the Form The Button My Auto Button is added to Form. Through this Button, the configuration Report 'My Auto Columns' is arrived at through the Auto columns mode. [Form : Mul Col Trial Balance] Bottom Button : My Auto Button,
TDL_Reference_Manual.pdf
Reports, Printing and Validation 132 [Button : My Auto Button] Key : Alt+N Action : Auto Columns : My Auto Columns Title : $$Locale String:"Auto Column" Figure 9. 11 Auto Column Reports Step 2: The Configuration Report 'Multi Auto Columns' 1. In configuration Report, the user will be given options like 'Days',' Monthly', Y early', 'Company', etc., based on which the columns are repeated. In TDL, these options are external objects. [Collection : My Auto Columns] Title : $$Locale String : "Column Details"Object : My Current Company, My Quarterly, My Monthly, My Yearly, My Half Yearly Filter : Belongs Format : $$Name, 15 ;; 'Belongs' is a system formula which filters the objects
TDL_Reference_Manual.pdf
Reports, Printing and Validation 13 3 ;; based on the value of the Meth ods 'Belongs If' of all the objects ;; Function Name returns the Name of any given object [Object : My Current Company] Name : $$Locale String : "Company" Var Name : "SVCurrent Company" Coll Name : "List of Primary Companies" Belongs If : $$Num Items : List Of Primary Companies > 1Is Age Wise : No Periodicity : "" ;; Function $$Num Items returns the number of selected companies ;; 'Belongs If' is a method of the object My Current Company, which ;; is used to control the display of the objects in the collection [Object : My Quarterly] Name : $$Locale String : "Quarterly" Var Name : "SVFrom Date, SVTo Date" Coll Name : "Period Collection" Belongs If : "Yes" Is Age Wise : No Periodicity : "3 Month" [Object : My Half Yearly] Name : $$Locale String:"Half-Yearly" Var Name : "SVFrom Date, SVTo Date" Coll Name : "Period Collection" Belongs If : "Yes" Is Age Wise : No Periodicity : "6 Month" [Object : My Monthly] Name : $$Locale String:"Monthly" Var Name : "SVFrom Date, SVTo Date" Coll Name : "Period Collection"
TDL_Reference_Manual.pdf
Reports, Printing and Validation 134 Belongs If : "Yes" Is Age Wise : No Periodicity : "Month" [Object : My Yearly] Name : $$Locale String:"Yearly" Var Name : "SVFrom Date, SVTo Date" Coll Name : "Period Collection" Belongs If : "Yes" Is Age Wise : No Periodicity : "Year" Figure 9. 12 Auto Repeat Columns Columns can be repeate d over any collection. They are not restricted only to a Period.
TDL_Reference_Manual.pdf
Reports, Printing and Validation 13 5 2. When the user selects any one of the options, the system vari ables need to be modified so that, the columns can be generated in the parent Report on the basis of these values. [Field : My Select Auto] Use : Short Name Field Table : My Auto Columns Show Table : Always [Field : My Auto Columns] Use : Short Name Field Invisible : Yes Set as : $$Table : My Select Auto : $Var Name Set always : Yes Skip : Yes ;; Function Table selects the Object Name from the previous Field My Select Auto ;; and displays the corresponding method value of Var Name [Field : My Coll Name] Use : Short Name Field Invisible : Yes Set as : $$Table : My Select Auto : $Coll Name Modifies : DSPRepeat Collection Set always : Yes Skip : Yes ;; We are modifying the value of the default variable DSPRepeat Collection by the value of the Method Coll Name from the selected Object DSPRepeat Col lection is repeated in the Default Variables SVCurrent Company, SVFrom Date and SVTo Date, which gets new values for each column [Field : My Start Period] Use : Short Date Field Invisible : Yes Set as : if $$Is Empty:$$Table:My Select Auto:$Periodicity then+ ##SVFrom Date else if $$Table : My Select Auto : + $Periodicity = "Day" then ##SVFrom Date else + $$Low Value : SVFrom Date
TDL_Reference_Manual.pdf
Reports, Printing and Validation 136 Set always : Yes Modifies : SVFrom Date Skip : Yes ;; Value of Variable SVFrom Date is set here based on the Periodicity Method. ;; $$Low Value is a Function that returns the beginning date of the Current Period [Field : My End Period] Use : Short Date Field Invisible : Yes Set as : if $$Is Empty : $$Table : My Select Auto : $Periodicity then + ##SVTo Date else if $$Table : My Select Auto : + $Periodicity = "Day" then $$Month End:#DSPStart Period + else $$High Value : SVTo Date Set always : Yes Modifies : SVTo Date Skip : Yes ;; Value of the Variable SVTo Date is set here based on the Periodicity Method. ;; Month End is a Function that gi ves the last day for a given month [Field : My Set Periodicity] Use : Short Name Field Invisible : Yes Set as : if NOT $$Is Empty : $$Table : My Select Auto : + $Periodicity then $$Table:My Select Auto : + $Periodicity else "Month" Set always : Yes Modifies : SVPeriodicity 3. The generated values are sent to the Parent Report by using t he Form attribute 'Output'. [Form : My Auto Columns] No Confirm : Yes Parts : My Auto Columns Output : My Auto Columns
TDL_Reference_Manual.pdf
Reports, Printing and Validation 13 7 Step 3: Repeating Columns over a Variable and Lines over Objects of a C ollection T o repeat columns over a V ariable which are captured in an Auto Columns Report, the following needs to be done at various components of the 'Mul Col Trial Bal ance' Report 1. Report Definition: This involves repeating the V alues of a System V ari able which is cap-tured in 'My Multi Columns' Report. [Report : Mul Col Trial Balance] Repeat : SVCurrent Company, SVFrom Date, SVTo Date 2. Part Definition: This involves repeating Lines over the Objects of a Collection. [Part: Mul Col TB Details] Lines : Mul Col TB Details Bottom Lines : Mul Col TB Total Repeat : Mul Col TB Details : Mul Col TB Group Led 3. Line Definition: This involves repeating a Field. [Line : Mul Col TB Details] Fields : Mul Col TB Name Field, Mul Col TB Amount Field Repeat : Mul Col TB Amount Field Figure 9. 13 Auto Column Report
TDL_Reference_Manual.pdf
Reports, Printing and Validation 138 Automatic Auto-Column Reports There may be situations when the columns are required automatic ally without the intervention of the user when the report is opened. The Attendance Sheet is an example of the Automatic autocolumn Report in T ally. ERP 9. Designing an Automatic Auto Column Report In order to design an Automatic Auto Column Report, the functio n $$Set Auto Columns, and the pre-defined variables Do Set Autocolumn and the DSPRepeat Collection are used. The following points must be considered while creating the auto matic auto-column reports: The value of the variable Do Set Auto Column must be set to YES. The variable DSPRepeat Collection stores the Collection Name to be repeated. The function $$Set Auto Columns accepts the name of a variable which is repeated over the value of variable 'DSPRepeat Collection'. The columns are displayed based on the values in the collection provided by variable 'DSPRepeat Collection'. Example : Consider the example of creating an auto-column for a Trial Bal ance. The same report can be modified to have automatic Columns for Multiple selected compan ies. As mentioned earlier, the following should be resorted to: The variable Do Set Auto Column must be set to Yes. [Report : Mul Col Trial Balance] Set : DSPRepeat Collection : "List of Primary Companies" The variable DSPRepeat Collection has to be set to “List of Primary Companies” [Form : Mul Col Trial Balance] Option : Set Auto Option : $$Set Auto Columns:SVCurrent Company Add a dummy option in the 'Form' Definition such that the condi tion of the same is $$Set Auto Columns:SVCurrent Company. The variable SVCurrent Company will be repeated automatically as soon as you enter the report, provided multipl e companies are loaded. Also add the following lines to the Form Definition 'Multi Col T rial Balance' Option : Set Auto Option : $$Set Auto Columns : SVCurrent Company [!Form : Set Auto Option] Multiple companies should be loaded for this program. Now, when the user selects the Menu Item, the following screen is displayed:
TDL_Reference_Manual.pdf
Reports, Printing and Validation 13 9 Figure 9. 14 Displaying Trial Balance for two different compan ies Columnar Report All the Voucher Reports which contain Accounting Information (L edger and/or Group Info) available in Vouchers, and can be displayed as Columns, are cat egorized as Columnar Reports. For example, Sales Register, Purchase Register, Journal Register, Ledger, etc., where the Voucher Registers can display multiple columns and respective v alues for each column, viz. the ledger, the parent of the ledger, etc., entered in the voucher, as opted by the user. Stock Registers and Sales Registers are a classic example of Co lumnar Reports. 2. Printing We have already understood the various types of reports and the techniques to generate them. An essential element of Reporting is printing. All the reports must be printable in one form or the other. Printing T echniques: The techniques used for Printing are as follows:These types of Reports also use the Auto Column concept for achieving disparate columns.
TDL_Reference_Manual.pdf
Reports, Printing and Validation 140 2. 1 Menu Action-Pr int/Print Collection Menu Action Print or Print Collection enters the final Report in 'Print' mode. Syntax [Menu : <Menu Name>] Add : Key Item:[Position] : <Display Item> : <Unique Key>: <Action Keyword> : <Action Parameter> ;; where Action Keyword can be 'Print' or 'Print Collection' which triggers a list and displays the ;; final report based on user selection Example : [#Menu : Printing Menu] Add : Key Item : My Ledgers : L : Print Collection : Ledger Vouchers Add : Key Item : My Day Book : D : Print : Day Book Here, we are adding the Item 'My Ledgers', which has an action 'Print Collection' associated to it. It displays a collection bearing the List of ledgers, which on user selection, enters the final report in 'Print' Mode. On accepting, it directly goes to the printer. 2. 2 Button Action -Print Report Another method of printing reports is by way of associating a B utton with an action 'Print Report' at the 'Form' definition. Action 'Print Report' prints the current report by default. Th is action accepts Report Name as its parameter. If any report other than current needs to be printed, an additional parameter containing Report Name needs to be specifi ed. The current report can pass the user selection to the printing report through a default col lection called 'Parameter Collection'. Syntax [Button : <Button Name>] Action : <Print Report> [: Action Parameter] Example : Consider a report displaying a list of employees, wherein the u ser selects the required employees for whom pay slips need to be printed. On clicking the 'Print' Button, the current report bearing the list of employees is not required. A new report printed for var ious pay slips allotted to the selected employees is needed. [Button : Print Selected Pay slips] ;; Associate this button to the current report displaying the list of employees Key : Alt + F11 Title : "Print Selected Pay slips" ;; Multiple Payslip Print Report will be printed on activation of this Button ;; The Report should be altered to include the inbuilt Collection 'Parameter ;; Collection' to print the user selection for the list of employees Action : Print Report : Multi Pay Slip Print
TDL_Reference_Manual.pdf
Reports, Printing and Validation 14 1 Scope : Selected Lines [#Report : Multi Pay Slip Print] Collection : Parameter Collection Here, the Button 'Print Selected Pay slips' is defined with the Action 'Print Report', which also has an action parameter, i. e., the Report Name to be printed. The scope of the Button is ' Selected Lines', which means that the final Report 'Multi Pay Slip Print ' must contain only the selected Objects from the current Report. The user selection is passed t o the new Report through a Collection 'Parameter Collection', which must be used in the de stination Report 'Multi Pay Slip Print'. So, the Report 'Multi Pay Slip Print' can be modified and added to the collection 'Parameter Collection'. 2. 3 Page Breaks A Page Break is the point at which one page ends and another be gins. Handling Page Breaks is important, as the current page should indicate continuation to the next page, while the next page must indicate that the current page is continued from the previ ous page. So, there must be a closing identifier, i. e., closing page break information and an opening identifier, i. e., opening page break information. In other words, Page Breaks specify the headers and footers for every page, and are printed across multiple pages. Closing Page Break starts printing from the first page and prints on every page except the last page, e. g., Continued... to be printed at the bottom of each page. Opening Page Break starts printing from the second page till the last p age. Closing Page Break is specified before Opening Page Break, since in any circumstance, closing page break is encountered first. In TDL, Page Breaks can be handled vertically as well as horizontally. T ypes of Page Breaks Vertical Page Breaks In cases where a report containing data cannot be printed in a single page, one needs to use vertical page breaks. Vertical Page Breaks can be specified at 2 levels, viz. Form and Part. Form Level Page Break Vertical Page Breaks can be specified at Form through the Form Attribute 'Page Break'. It takes 2 parameters, viz. First Part for Closing Page Break and Second Part for Ope ning Page Break. Syntax [Form: <Form Name>] Page Break : <Closing Part>, <Opening Part> Example : Consider a Trial Balance report of a company, which requires the title and address of the Company in the first page and the grand total in the last page. In the pages between the first and the last page, the text Continued.... may be required at the end of each page, and the Company Name and Address at the beginning of each page. [Form : My Trial Balance] Page Break : Cl Page Break, Op Page Break
TDL_Reference_Manual.pdf
Reports, Printing and Validation 142 ;; where both Cl Page Break and Op Page Break are Parts [Part : Cl Page Break] Lines : Cont Line [Line : Cont Line]Fields : Cont Field Border : Full Thin Top [Field : Cont Field] Set As : “Continued... ” Full width : Yes Align : Right [Part : Op Page Break] Parts : DSP Op Company Name, DSP Op Report Title Vertical : Yes In this example, Closing Page Break is defined to print Continued... at the end of every continued page. Opening Page Break is defined to print the Company Name a nd Report Title at the beginning of all the continuing pages. Since more than one part is used within Part definition, specify the alignment as 'Vertical', if required. Part Level Page Breaks Vertical Page Breaks can be specified at Part through the Part Attribute Page Break. This is generally used when the Page T otals are to be printed for each closing and opening pages. It takes 2 parameters, viz. 1st Line for Closing Page Break and 2nd Line for Opening P age Break. Syntax [Part : <Part Name>] Page Break : <Closing Line>, <Opening Line> Example : Consider a Trial Balance Report of a company, where we may require the running page totals to be printed at the end and beginning of each page. [Part : My Trial Balance] Page Break : Cl Page Break, Op Page Break ;; where both Cl Page Break and Op Page Break are Lines [Line : Cl Page Break] Use : Detail Line
TDL_Reference_Manual.pdf
Reports, Printing and Validation 14 3 Local : Field : Particulars Fld : Set As: “Carried Forward” Local : Field : Dr Amt Fld: Set As : $$Total:Dr Amt Fld Local : Field : Cr Amt Fld: Set As : $$Total:Cr Amt Fld Local : Field : Net Amt Fld: Set As : $$Total:Net Amt Fld Border : Full Thin Top [Line : Op Page Break] Use : Cl Page Break Local : Field : Particulars Fld : Set As : “Brought Forward” Here, Line 'Cl Page Break' is defined to use the pre-defined 'D etail Line' and the relevant fields are modified locally to set the respective values. Similarly, t he Line 'Op Page Break' is defined to use the above defined line 'Cl Page Break', which locally modif ies only the field 'Particulars Fld'. Horizontal Page Breaks Horizontal Page Breaks are used if the number of columns run in to multiple pages. Line Level Page Breaks Horizontal page breaks can be specified at Line through Line At tribute 'Page Break'. It is generally used to repeat a closing column at every closing page and openi ng column at every opening page. It takes 2 parameters, viz. 1st Field for Closing Page Break & 2nd for Opening Page B reak. Syntax [Line : <Line Name>] Page Break : <Closing Field>, <Opening Field> Example : Consider a Columnar Sales Register Report of a company, where multiple columns are printed across pages. Some fixed columns are required in subsequent pag es which makes it easy to map the columns in subsequent pages. [#Line : DSP Col Vch Detail] Page Break : Cl Page Break, Op Page Break ;; where both Cl Page Break and Op Page Break are Fields [Field : Cl Page Break] [Field : Op Page Break] Fields :DBC Fixed, VCH No
TDL_Reference_Manual.pdf
Reports, Printing and Validation 144 In this example, the Field Cl Page Break is defined as Empty, since no Closing Column or Field is required and Field Op Page Break is defined with further fields DBC Fixed and VCH No, which are available in default TDL. Table 9. 1 Comparison between different page breaks 2. 4 Frequently Used Attr ibutes and Functions Attributes Line Level Attribute-Next Page The 'Next Page' attribute specifies the cut off line that gets printed in the subsequent page. It accepts a logical formula as its parameter. Syntax [Line : <Line Name>] Next Page : <Logical Formula> Example : [Line : DSP Vch Explosion] Next Page : (($$Line Number = $$Last Line Number) AND $$Is Last Of Set) Attribute-Preprinted/Pre Printed Border The Attribute 'Preprinted' or 'Preprinted Border' can be specif ied at Part, Line and Field Defini tions. These attributes work in conjunction with 'preprinted/ p lain' button in the Print Configuration screen. When the Preprinted attribute is set to YES, the conten ts of the current Part, Line or Field will be left blank assuming the same to be pre-printed. When th e 'Preprinted Border' attribute is set to YES, the borders used in the current Part, Line or Field will be assumed to be pre-printed. Syntax [Line : <Line Name>] Preprinted : <Logical Value>Form Level Page Break Part Leve l Page Break Line Level Page Break It is a Vertical Page Break It is a Vertical Page Break It is a Horizontal Page Break Page Break attribute accepts Part Names as its value Page Break attribute accepts Line Names as itsvalue Page Break attribute accepts Field Names asits value Multiple Parts (parts within parts) can be printed both atclosing and opening pagebreaks Multiple lines (lines within lines) can be printed at bothclosing and opening pagebreaks Multiple Fields (Fields within Fields) can beprinted at both closingand opening page breaks Form Level Page Breaks cannot handle running Page To t a l s Running Page T otals can be handled with Part Level Page Break Column Page T otals can be handled with Line Level Page Break
TDL_Reference_Manual.pdf
Reports, Printing and Validation 14 5 Example : [Line : Company Name] Preprinted : Yes Functions Functions-$$Page No and $$Part No The $$Page No function returns the current Page Number while the $$Part No function returns the current Part Number of the page. These functions do not require any parameter and the return typ e for $$Page No is Number and $$Part No is String. Syntax $$Page No $$Part No Example : [Field : My Page No] Set as : “Page ” + $$String:$$Page No+ “ (“ + $$Part No + “)” Function-$$Is Last Of Set It is used to check if the current Form is the last Form being printed. It doesn't require any parameter. It returns TRUE, if the current Form is the last Form being pr inted, else returns FALSE. Syntax $$Is Last Of Set Example : [Line : DSP Vch Explosion] Next Page : (($$Line Number = $$Last Line Number) AND $$Is Last Of Set) Function-$$Do Explosionsfit In the process of printing, if a line is exploded, then this function can be used to check whether the exploded part fits within the current page. This function also doesn't require any parameter and returns its logical value. It returns its logical value as YES, if it is True. Syntax $$Do Explosions Fit Example : [Line : EXPSMP Inv Details] Next Page : NOT $$Do Explosions Fit OR (($$Line Number = $$Last Line Number)
TDL_Reference_Manual.pdf
Reports, Printing and Validation 146 $$Balance Lines It is used to check the balance number of lines in the repeated lines, including the exploded part lines present, in a given part. Scroll : Vertical must be specified at 'Part' definition in order to use this function. This function too does not require any parameter and returns a Numerical value. Syntax $$Balance Lines Example : [Line : Acc Type Detail] Next Page : ($$Balance Line > 0) AND (($$Balance Lines < 5) Here, if the Balance number of lines is between 0-5, remaining lines will be printed on next page. 3. Validation and Controls Data validation and controls in T ally can be done at two levels, either at the Platform level or at the TDL level. TDL Programmers do not have control over any of the Platform level validations. TDL Programmers can only add validation and controls at the TDL Lev el. Let us understand some of the TDL Level validation and control mechanisms. 3. 1 Field Level Attribute-Validate This attribute checks if the given condition is satisfied. Unle ss the given condition for 'V alidate' is satisfied, the user cannot move further, i. e., the cursor remains placed on the current field without moving to the subsequent field. It does not display any error m essage. Syntax Validate : <Logical Formula> Example : [Field : CMP Name] Use : Name Field Validate : NOT $$Is Empty : $$Value Storage : Name Style : Large Bold In this example: The field CMP Name is a field in Default TDL which is used to c reate/ alter a Company. Attribute 'V alidate' stops the cursor from moving forward, unle ss some value is entered in the current field. The function $$Is Empty returns a logical value as TRUE, only if the parameter passed to it contains NULL. The function $$V alue returns the value entered in the current f ield.
TDL_Reference_Manual.pdf
Reports, Printing and Validation 14 7 Thus, the Attribute 'V alidate', used in the current field, cont rols the user from leaving the field blank, and forces a user input. 3. 2 Field Level Attribute — Unique This attribute takes a logical value. If it is set to Yes, then the values keyed in the field have to be unique. If the entries are duplicated, an error message Duplicate Entry pops up. This attribute is useful when a Line is repeated over UDF/Collection, in order to avoid a repetition of values. Syntax Unique : [Yes/No] Example : [!Field : VCHPHYSStock Item] Table : Unique Stock Item : $$Line = 1 Table : Unique Stock Item, Endof List Unique : Yes In this code snippet, the field VCHPHYSStock Item is an optional field in Def TDL, which is used in a Physical Stock Voucher. The attribute Unique avoids the repetition of Stock Item names. 3. 3 Field Level A ttribute — Notify It is similar to attribute 'V alidate'. The only difference is t hat it flashes a warning message and the cursor moves to the subsequent field. A system formula is added to display the warning message. Syntax Notify : <System Formula> : <Logical Condition> Example : [!Field : VCH Nrml Billed Qty] Set as : if @@Has Inv Sub Alloc then $$Coll Qty Total: + Batch Allocations : $Billed Qty else @Reset Val Skip On : @@Has Inv Sub Alloc Style : if @@Is Inv Vch then "Normal" else "Normal Bold" Notify : Negative Stock : ##VCFGNegative Stock AND + @@Is Outward Type AND$$In Create Mode AND + $$Is Negative : @@Final Stock Total Here, VCH Nrml Billed Qty is a default optional field in TDL used in a Voucher. 'Notify' pops up a warning message, if the entered quantity for a stock item is more than the avai lable stock, and the cursor moves to the subsequent field.
TDL_Reference_Manual.pdf
Reports, Printing and Validation 148 3. 4 Field Level Attribute-Control The attribute 'Control' is similar to Notify. The only differen ce is that it does not allow the user to proceed further after displaying a message. The cursor does not move to the subsequent field. Syntax Control : <System Formula : Logical Condition> Example : [Field : VCH Number] Use : Voucher Number Field Inactive : @@No Vch Numbering Skip On : @@Auto Vch Numbering Control : Duplicate Number : @@No Dup Vch Numbering AND + (NOT $$In Alter Mode OR NOT @Same Vch Type And Num)AND + $$Is Duplicate Number : $$Value : Same Vch Type And Num : $Voucher Type Name = ##ORIGVch Type AND + $$Value = ##ORIGVch Num Validate : (@@No Dup Vch Numbering AND NOT $$Is Empty:$$Value) + OR NOT @@No Dup Vch Numbering Keys : Prev Vch Number In this example, the field, VCH Number is a default field in TDL, used in a Voucher. The duplication of voucher numbers for a particular voucher type is prevented by using the attribute Control. The differences between the field attributes V alidate, Notify a nd Control are: Table 9. 2 Difference between t he validation control attribute s 3. 5 Form Level Attribute-Control This attribute achieves a higher level of control on the conten ts of a Form, compared to the other controls used at the Lower levels of the Form. If the condition specified with 'Control' is not satisfied, then the Form displays an error message while trying to save. The Form cannot be saved until the condition in the attribute 'Control' is fulfilled. Field Attributes Displays Message Cursor Movement V alidate No Restricted Notify Y es Not Restricted Control Y es Restricted
TDL_Reference_Manual.pdf
Reports, Printing and Validation 14 9 Syntax Control : <String Formula : Logical Formula> Example : [Form : Voucher] Control : Date Below Books From : $Date < + $Books From:Company : ##SVCurrent Company Control : Date Below From Date : $Date < $$System Period From Control : Date Beyond To Date : $Date > $$System Period To In this example, V oucher is a default Form. While creating a voucher, the attribute Control does not accept dates beyond the financial period or before beginnin g of the books. 3. 6 Menu Level Attribute-Control The attribute Control restricts the display of Menu Items, based on the given conditi on. Syntax Control : <Item Name> : <Logical condition> Example : [!Menu: Gateway of Tally] Key Item : @@loc Accounts Info : A : Menu : Accounts Info. : NOT + $$Is Empty:$$Selected Cmps Control : @@loc Accounts Info : $$Allow:Create:Accounts Masters OR + $$Allow:Alter:Accounts Masters Here, the menu item Accounts Info will be displayed only if the condition is satisfied. $$Allow checks if the current user has the rights to access the report displayed under the current Menu item. The value Accounts Masters has been derived from attribute 'Family' at 'Report' definition. 3. 7 Report Level Attribute-Family The value specified with the attribute Family is automatically added to the security list as a pop-up, while assigning the rights under Security Control Menu. Syntax [Report : <Report Name>] Family : <String Value> Example : [Report : Ledger] Family : "Accounts Masters" Here, Accounts Masters will get added to the Security list. Without the user rights fo r 'Accounts Masters' in the Security controls, this report can neither be c reated, altered nor viewed.
TDL_Reference_Manual.pdf
Reports, Printing and Validation 150 Learning Outcome T ally. ERP 9 caters to 3 different types of Reports. These are: T abular Reports: Reports with fixed number columns, which can b e configured Hierarchical Reports: Reports in successive levels or layers Column based Reports: Reports with multiple columns 'Explode' is a Line attribute, which is used to take the curren t data from the Line Object. $$Key Explode function gives the current status of the keys Shif t and Enter. This is used as a condition to check if the user has pressed the Shift+Enter Ke ys. Multi column report is one where a column repeats, based on criteria specified by user. Page Break is the point at which one page ends and another begi ns. Data validation and controls in T ally can be done at 2 levels, viz. Platform and TDL levels.
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 15 1 V oucher and Invoice Customisation Introduction A voucher is a primary document that contains all the informati on regarding a transaction. T o begin with, it is necessary to understand the classification of vouchers a nd their structure. Voucher and Invoice Customisation will be dealt with later in t his T opic. 1. Classification of V ouchers For every transaction in T ally, you can make use of an appropriate voucher to enter all the required details. Vouchers are broadly classified into three ty pes: Accounting Vouchers Inventory Vouchers Accounting-cum-Inventory Vouchers 1. 1 Accounting V ouchers Accounting Vouchers imply recording transactions which require only the accounting details that do not have any impact on the inventory. Receipt, Payment, Contra and Journal Vouchers are all Accounting Vouchers. In cases where the option Inventory Values are affected? (which is used for Journal/Payment/ Receipt entries) is set to Yes in the Ledger Master, the entries made will also accept the stock items. However, this is not a standard business practice. Entries of this sort, are usually reflected in the Inventory Reports. These transactions affect only the Accounting Reports.
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 152 1. 2 Inventory V ouchers Inventory Vouchers imply the recording of transactions which re quire details pertaining only to the inventory and do not have any impact on accounts. Stock Journal and Physical Stock Vouchers are both Inventory Vouchers. 1. 3 Accounting-cum-Inventory V ouchers Accounting-cum-Inventory Vouchers are transactions containing d etails pertaining to Accounts as well as Inventory. Purchase Order, Receipt Note, Rejection In, Debit Note, Purchase, Sales Order, Delivery Note, Rejection Out, Credit Note, Sales, etc. are all Accounting-cum-Inventory Vouchers. 2. The Structure of a V oucher Object A Voucher Object stores two types of information: Base Informat ion and Actual Entries. Base Information consists of base methods like Voucher Number, Date, Reference, Narration and so on, which are common to all the voucher types. Actual Entries are the entries pertaining to Accounts and Inventory. The following six collections have been introduced to handle tr ansactions based on the three types of vouchers explained earlier. They are: Ledger Entries Inventory Entries All Ledger Entries All Inventory Entries Inventory Entries In Inventory Entries Out These transactions do not affect the Accounting Reports, except when the Closing Stock value is computed and the option of 'Integrate Accounts and Inventory' is set to YES in F1 1:Accounting/Inventory Features. Purchase Orders, Receipt Notes, Rejection Ins, Sales Orders, Delivery Notes and Rejection Outs only affect the Inventory Reports whereas Debit Notes, Purchase Notes, Credit Notes and Sales affect the Accounting as well as Inventory Reports, if the T racking Number is set to 'Not Ap plicable', else it affects only the Accounting Reports.
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 15 3 The hierarchy of Voucher Objects is as shown below: Figure 10. 1 Hierarchy of V oucher objects The base entries of a Voucher are Date, Voucher Type, Voucher N umber, etc. The first level consists of two basic collections, namely Ledger Entries and Inventory Entries. Each Ledger Entry Object has its own Base Methods like Ledger Name, Amount, Bill Allocation Collection and Cost Category Allocation Collection. Each Cost Category Allocation Object in turn, contains its own Methods, which are Name, Amount and a Cost Cen tre Allocation Collection. Accounting V ouchers use collections of the following type: Ledger Entries All Ledger Entries Inventory V ouchers use collections of the following type: Inventory Entries All Inventory Entries Inventory Entries In Inventory Entries Out Accounting-cum-Inventory V ouchers use collections of the follow ing type: Ledger Entries All Ledger Entries Inventory Entries All Inventory Entries
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 154 3. Customisation A user usually enters transactions in a voucher and prints it i n the default format provided. However, there may be instances, when the user would want to have it pr inted in a format other than the default one provided in T ally. In such circumstances, the user may have to get it customised according to the company needs. In cases where there is a requirement for customisation, adhere to the following steps: 1. Analyse the format required by the company to judge whether The requirement can be met with the default format with some mi nor changes. OR A new format needs to be designed 2. Check whether any additional input fields are required. If required, add the appropriate UDFs at relevant places. 3. Identify the definitions that need to be altered to suit the user requirements. 3. 1 V oucher Customisation Let's consider the following examples to understand the concept of Voucher Customisation. Case 1 Problem Statement A Company named 'ABC Company Ltd' needs the Cheque No., Date an d Bank Name printed on a Payment/Receipt Voucher and Receipt. There should also be an op tion of whether the Cheque details are to be printed or not. Solution Step 1 : Add additional fields to capture the Bank Name, Cheque Number and Cheque Date For this, the following UDFs are created. [System : UDF] Bank Name : String : 1000 Narr WOCh : String : 1001Cheque Number : Number : 1000Chq Date : Date : 1000 The UDFs mentioned above are used in the existing Part VCH Narration. [#Part : VCH Narration]In this chapter, we would be referring input screens as Vouchers and print screens as Invoice.
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 15 5 ;;Modify the Narration Part to add the details Add : Option : Bank Det VCH Narration : @@Is Payment OR @@Is Receipt Add : Option : Bank Det VCH Narration Rcpt : @@Receipt After Save On entering the required details, the screen of the Receipt Vou cher looks as follows: Figure 10. 2 Alteration sc reen of a Receipt V oucher Step 2 The Configuration screen of Receipt and Payment Voucher is alte red to add a new option. In this, the existing Parts Payment Print Config and Receipt Print Config have been altered. ;; Payment Config Changes [#Part : Payment Print Config] Add : Lines : Before : PPRVch Narr : PPR Chq Details ;; Receipt Config Changes [#Part : Receipt Print Config] Add : Lines : After : PPRWith Cost : PPR Chq Details Step 3 The existing Field PPR Narr and Part PPRBottom Details are altered to get the required Receipt/Payment Voucher.
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 156 [#Field : PPR Narr] Option : PPR Narr Rct Pymt [#Part : PPRBottom Details] Option : PPRBottom Details Rct Pymt : (@@Is Payment OR @@Is Receipt) AND ##PPRChq Info The print out of a Customised Receipt Voucher is as follows: Figure 10. 3 Print p review of a customised Receipt V oucher
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 15 7 Step 4 The existing Field PRCT Thru is altered to get the required Receipt/Payment Voucher. [#Field : PRCT Thru] Option : PRCT Thru Rct Pymt : @@Is Receipt The print out of a Customised Receipt is as shown: Figure 10. 4 Print Preview of a customised Receipt V oucher Case 2 Problem Statement Consider adding columns for Marks and Number of Packages to Sal es Voucher, instead of lines which are already available by default in T ally. Solution T o add a column in the Invoice screen, you should know: The position in which you have to add a field
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 158 The number of lines to be altered to incorporate the new field The type of UDF required for the field (if required) The steps to be followed are listed below: Firstly, identify the lines that have to be altered to add the required fields. Check the field name in the column title and the details of lin es in the inventory entries made. Similarly, check the ledger entries collection including batch allocations, total and subtotal lines. Check all the lines that may be effected in the invoice portion. Add the field in all the lines found. The following lines are to be altered to achieve the required m odification: ;; Invoice Column Headings1 without class [Line : EI Column One] ;; Invoice Column He adings2 with class [Line : EI Column Two] ;; Invoice Inventory Entries without Class [Line : EI Inv Info] ;; alternate quantity details line [Line : STKVCH Alt Units] ;; Invoice Inventory Entries with Class [Line : CI Inv Info] ;; are added at the form level [Form : Export Invoice]
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 15 9 The following screen shows two input fields added or relocated in the Inventory Entries details: Figure 10. 5 V oucher Alteration screen with new fields Refer to the sample code for the same. Case 3 Problem Statement Consider adding a Subform for a stock item to enter the Height and Width. The dimension is calculated on basis of the Height and Width entered, and the sa me is reflected in the Quantity field. Solution T o add a Subform, one should know: The field at which a Subform needs to be called, with or withou t any condition. How to define a Subform Report and its components. Whether the Subform would effect the main screen from which it was called, with any modifications. Care should be taken to consider all situations, while addressi ng similar requirements, such as with or without activation of Actual and Billed Quantity, with or without Batch wise screen, etc.
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 160 The following lines are to be altered to achieve the required m odification: [#Field : VCHACC Stock Item] Add : Sub Form : At Beginning : Stk VCH Dimension : NOT $$Is End : $Stock Item Name Figure 10. 6 Sub Forms Refer to the sample code for the same. Case 4Problem Statement Altering an existing Discount column that would change the defa ult working of T ally. Solution T o achieve this, first change the default Discount column from Percentage to Amount. The changes that should be done in the default T ally screen are : Reformat Discount at Price level [#Field : MPSDiscount Title] Set as : "Discount Amt"
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 16 1 Reformat Discount at Inventory Entries not to show the Percent sign [#Field : VCH Discount] Delete : Format Add : Format: "No Percent,No Zero" Reformat Discount at Batch Allocations not to show the Percent sign [#Field : VCHBATCH Discount] Delete : Format Add : Format : "No Percent,No Zero" Change the valuation accordingly in VCH Value ;; T o change the Invoice Value field when there are no Batch Allocations [#Field : VCH Value] Reset Val : if (@@No Base Units OR $$Is Empty:$Billed Qty) then $$Value + else (($Rate * $Billed Qty)-$Discount) Change the formula by which the discount is calculated ;; Recalculate the fo llowing Formula rest will be taken care by T ally [System : Formula] Calced Amt : ($Rate * $Billed Qty)-$Batch Discount Nrml Amount : ($Billed Qty * $Rate)-$Batch Discount
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 162 Figure 10. 7 Stock Ite m Allocation Screen 3. 2 Invoice Customisation Invoice Customisation can broadly be classified into two catego ries based on the requirement: Invoice Customisation-User defined format Invoice Customisation-Modifications to default format Invoice Customisation-User Defined Format A totally new Invoice format needs to be developed in this cate gory, after which it can be enabled in the following two different ways: Adding new format along with the default format Replacing the existing format with a new one
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 16 3 Adding a new format along with the default format T o create a new format of invoice by modifying the existing For m Sales Color in addition to the default 'Print' Report code. This manner of Customisation begin s with the following code snippet: [#Form : Sales Color] Add : Print: Sales Invoice [Report : Sales Invoice] Form : Sales Invoice Object : Voucher In this code snippet, the default 'Print' Report is deleted, th e Report Sales Invoice is added and the Object V oucher is associated to it. However, in the previous example, it was not necessary to associate the 'Voucher' Object, since it was already associated in the default Report 'Printed Invoice'. Case 1 Problem Statement ABC Company Ltd. requires a Sales Invoice which in turn requires the following format in addition to the default Sales Invoice.
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 164 Figure 10. 8 Invoice Customisation-Comprehensive Replacing the existing format with a new one By default, the basic formats provided for Commercial Invoice P rinting are: Normal Invoice, i. e., Comprehensive Invoice
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 16 5 Simple Invoice, i. e., Simple Printed Invoice The Comprehensive Invoice and Simple Printed Invoice are two optional forms which are executed on the basis of satisfying a given condition. The defa ult option available for print is the Comprehensive Invoice. A Simple Invoice is printed if the option Print in Simple Format is set to Yes in F12 : Configuration. On the other hand, a Comprenhensive Invoice is p rinted only if the user opts for a 'Neat' Format mode of printing, and the option mentioned above is set to No. Case 1 Problem Statement
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 166 ABC Company Ltd. requires a Sales Invoice which in turn require s the following format for both a Normal Invoice as well as a Simple Invoice. Figure 10. 9 Invoice C ustomisation-Simple Solution Step 1
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 16 7 Default Forms for a Comprehensive Invoice and Simple Printed In voice are modified with an optional Form. [#Form : Comprehensive Invoice] Add : Option : My Invoice : @@Is Sales [#Form : Simple Printed Invoice] Add : Option : My Invoice : @@Is Sales Step 2 The Parts and Page Breaks of the default Form are deleted and n ew Parts are added. T o begin with, the Invoice is classified into three parts: T op Part, Body Part and Bottom Part These Parts can be further divided into any number of Parts acc ording to the user's requirement. [!Form : My Invoice] Delete : Parts Delete : Bottom Parts Delete : Page Break Space Top : 0 Space Bottom : 0 Space Left : 0 Space Right : 0Add : Part : My Invoice Top Part Add : Part : My Invoice Body Part Add : Bottom Part : My Invoice Bottom Part Invoice Customisation-Modifications to default format There may be a requirement in an Invoice customisation which is similar to the default T ally format with some minor changes. In such cases, one can just alter the default definitions as required. Case 1 Problem Statement A Company ABC Company Ltd. requires an Invoice with its Terms a nd Conditions as shown:
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 168 Figure 10. 10 Inv oice Customisation Solution Step 1
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 16 9 The default configuration Part IPCFG Right is altered to add the Line. [#Part : IPCFG Right] Add : Lines : Global With Terms Step 2 The default Part EXPINV Excise Details is altered to cater to the requirement. [#Part : EXPINV Excise Details] Delete : Lines : EXPINV Excise Range, EXPINV Excise Range Addr, + EXPINV Excise Div, EXPINV Excise Div Addr, + EXPINV Excise Serial, EXPINV Invoice Time, + EXPINV Removal Time Add : Lines : EXPINV Sub Title, EXPINV Excise Details Repeat : EXPINV Excise Details : Global Terms Local : Field : EXPINV Sub Title : Info : "Terms & Conditions :"Local : Field : EXPINV Sub Title : Border : Thin Bottom Local : Line : EXPINV Sub Title : Space Bottom : 1 Invisible : NOT @@Is Invoice OR NOT ##Show With Terms Case 2 Problem Statement Sorting Inventory Entries as per user requirement. Solution The Inventory Entries of an invoice are printed in the order in which they are entered. This order can be changed as per user requirement. The sorting can be done in either ascending or descending order in terms of the item name, stock group, stock category, units of measure, rate, value, and so on. T o denote the descending order, attach '—' sign to it. T o change the order of the default invoice: Define a Collection of inventory entries in the desired sorted order [Collection : Sorted Inventory Entries] Type : Inventory Entries : Voucher Sort : Default :-$Parent : Stock Item:$Stock Item Name, $Stock Item Name Note the Part in which the statement 'repeat Line of Inventory entries' is mentioned in the Def TDL and Change this Part to 'repeat the Line with the new Co llection defined'. [#Part : EXPINV Inv Info]
TDL_Reference_Manual.pdf
Voucher and Invoice Customisation 170 Repeat : EXPINV Inv Details : Sorted Inventory Entries ;; End-of-Code Learning Outcome Vouchers are broadly classified into three types: Accounting Vouchers Inventory Vouchers Accounting-cum-Inventory Vouchers Voucher Objects store two types of information-Base Information and Actual Entries.
TDL_Reference_Manual.pdf
Section II TDL Language Enhancements
TDL_Reference_Manual.pdf
TDL_Reference_Manual.pdf
175 Writing Remote Compliant TDL Reports Introduction Enabling access to your organisational data 'anytime, anywhere', and yet being truly usable, is what T ally. ERP 9 is capable of. With remote access, it will be possible for the owner or any authorized user to access T ally. ERP 9 data from anywhere. With this capability, they will be able to access all the reports and information from a remote location. All this has been made possible by adopting Client/Server archi tecture in the product. The underlying principle of any client/server environment is the co mmunication between client and server in a request/response fashion. The request/response is in the form of XML. Client sends request and the server responds. T ally. ERP 9 family, the default product delivers the capability to access any TDL reports from anywhere. There have been significant enhancements in T ally pla tform at the Collection, Report and Function Levels for delivering this capability. The way TDL Reports have been changed in default TDL to optimise the performance and seamlessly work wit hout clogging the network is the focus of this chapter. The idea is to reduce the server calls for accessing the data. The same concepts can be followed for making the customized Reports Remote Compliant. Given below is the overall enabled environment using Tally. NET Server. Figure 12. 1 Overview of Tally. NET Server We will begin our discussion with an overview of client/server environment in general, and then move on to T ally Client/Server, and the role of T ally. NET Server in such a scenario. The topic s covered henceforth will focus on understanding the execution of TDL reports and optimising the code for executing in this environment.
TDL_Reference_Manual.pdf
Writing Remote Com pliant TDL Reports 176 1. Client/Server Archite cture-An Overview Clients and Servers are separate logical entities that work tog ether over a network to accomplish a task. A client is defined as a requester of services and a serv er is defined as the provider of services. Figure 12. 2 Block diagram of client/server architecture Some of the advantages of client/server architecture are as fol lows: Centralization-Resources and data security are controlled through the server. Scalability-Entire system can be scaled horizontally or verti cally. Accessibility-Server can be accessed remotely. 2. T ally Client/Server Architecture using T ally Software Servic es TSS (Tally Software Services) is a framework which provides a n umber of services to the T a l l y. E R P 9 u s e r s. T h e TSS architecture is derived from client/server architecture. In this architecture, T ally. ERP 9 Client is connected to T ally. ERP 9 server via middle-ware, i. e., T ally. NET Server. Following are the major components of the TSS architecture. T ally. NET Server T ally. ERP 9 Server T ally. ERP 9 Client 2. 1 T ally. NET Server The communication between T ally. ERP 9 Server and T ally. ERP 9 client is being handled by T ally. NET Server. It provides the Routing services for T ally. It is through T ally. NET Server that we are able to provide an entire range of services, which we commonly refer to as TSS features. The user can utilize T ally. NET Server to Synchronize data, access online help and su pport and
TDL_Reference_Manual.pdf
Writing Remote Compliant TDL Reports 17 7 manage licenses across locations, while the auditor can use it to scrutinise the client's data from a remote location. All this can be done in a secured environment. The system administrator can create users with the rights to ac cess or audit data from a remote location and assign controls based on their security level for the required company only. T h e remote users accessing the company data behave as clients on T a lly. NET Server. T ally. NET Server takes care of user authentication when a remote user tries to connect to the T ally. ERP 9 Server. TSS Features Register and Connect companies from T ally. ERP 9 Create and maintain Remote Users Remote availability of Auditor's License Synchronize data Remote access of data by any user Use online help and support capabi lity from within T ally or bro wser Application Management (across Multi-serial, Multi-Location, etc. ) via T ally or browser Figure 12. 3 T ally. NET Server Architecture 2. 2 T ally. ERP 9 Server T ally. ERP 9 Server is a typical T ally application which hosts the T al ly Company and is always connected to the T ally. NET Server. User creation, authorization, connecting the company to Ta l l y. N E T S e r v e r, etc., is handled at this end. 2. 3 T ally. ERP 9 Client T ally. ERP 9 Client is a typical T ally application. T ally client can remotely access the T ally Company which is hosted by T ally server. Authenticated users connect to enabled companies from this end.
TDL_Reference_Manual.pdf
Writing Remote Com pliant TDL Reports 178 3. Setting up Tally. NET Server for Remote Access Following are the steps which need to be executed to setup the T ally. NET Server: Step 1: Enable Security control to avail TSS features. Go to Gateway of Tally. Click F3 :Company Info > Alter Step 2: Configuring TSS features. Go to Gateway of Tally. Click F11:Features > TSS Features Step 3: Authorizing the Remote Users. Go to Gateway of T ally. Click F3 :Company Info > Security Control > Users & Passwords Step 4: Connecting Companies to T ally. NET Server Go to Gateway of T ally. Click F4:Connect CompanyUsers classified under the security level T ally. NET User and T ally. NET Auditor should be created individually by the system administrator. 'Allow Remote Access' should be set to YES only if the client wants his T ally. NET Auditor/T ally. NET User to access data remotely. If 'Allow Local TDLs' is set to YES, th en the client can load Local TDLs, in addition to remote TDLs. If it is set to NO, the client cannot load Local TDLs.
TDL_Reference_Manual.pdf
Writing Remote Compliant TDL Reports 17 9 4. Setting up the Client T ally The users classified as T ally. NET User or T ally. NET Auditor can access data by logging in from a remote location. The user has to execute the following steps to login as a remote user: Step 1:Get connected to Tally. NET Server Figure 12. 4 Connect to Tally. NET Server Step 2: Provide the User name and Password Figure 12. 5 Providing User Name and Password After entering of valid user name & password, T ally displays sc reen to select the remote company.
TDL_Reference_Manual.pdf
Writing Remote Com pliant TDL Reports 180 Step 3: Load the Remote company Figure 12. 6 Loading Remote Company The above screen displays the list of companies to which the re mote user has access. First, all the Online companies are listed, followed by the list of offlin e companies. 5. TDL-In a Client/Server Environment In a client/server environment, data resides in the server. A typical client will have only user interface. Whenever the client requires data, it has to send a request to the server with credentials, and the server will respond with the data. In TSS environment, the server and the client exchange the requ est/response in encrypted XML format. When the client is T ally application, it will have only the user interface and needs to get data from the server on demand. A typical T ally application is developed using TDL. In TDL language, d e f i n i t i o n s a r e b r o a d l y c l a s s i f i e d a s D a t a O b j e c t s a n d I n t e r f a ce Objects. Interface objects define the user interface and Data objects store the va lues in T ally primary or secondary database. T ally client will have only Interface Objects locally and the Data Objects need to be fetched from the server on request. It is the TDL Programmer's responsibility to fetch the required data from the T ally server to T ally Client.
TDL_Reference_Manual.pdf
Writing Remote Compliant TDL Reports 18 1 6. TDL Enhancements for Remote TDL language has been enhanced with the client/server capabilit y. Collection and Report definitions are enhanced to mak e server calls. Enhancements hav e taken place in the platform for the execution of Functions and Actions. 6. 1 Collection Enhancements In TDL, 'Collection' definition is a data repository which cont ains the data objects. Whenever T ally Client uses a Collection, it has to fetch the objects from the Remote server. But a T ally Client need not require the all the methods of an Object. Also fetching the entire Object may be costly in terms of network bandwidth. The required methods of an object(s) at the T ally Client are fe tched using the Collection attribute 'Fetch'. In addition to 'Fetch' attribute, methods doing aggreg ation or computation using 'Aggr Compute' & 'Compute' are also brought to the T ally Client. Internally fetching a method will generate an XML fragment, which will be sent to the T ally Server as a request. 1. Fetch Syntax Fetch : Existing-Method-Name-in-Source,... Where, <Existing-Method-Name-in-Source> are the internal methods of the Object which needs to be fetched to the Client. 2. Compute Syntax Compute : Method-Name : Method-Formula Where,<Method-Formula> is any computational method, and <Method-Name> denotes the name of the method. Example: Fetching Name & Closing Balance of Ledger Object Step 1:-Fetching Name and Closing Balance methods of 'Ledger' object [Collection : Ledgers] Type : Ledger Fetch : Name, Closing Balance, Parent Compute : PClosing Balance : $Closing Balance : Group : $Parent Please refer 'TDL Enhancements for T ally. ERP 9. pdf' for further information on Col-lection attributes 'Aggr Compute', 'Compute' and 'Fetch'
TDL_Reference_Manual.pdf
Writing Remote Com pliant TDL Reports 182 Format : $Name, 15 Step 2: Utilizing the fetched methods a) As a T able [Field : Sample Field] Table : Ledgers Show Table : Always b) In 'Repeat' at Part Level [Part : Sample Part] Line : Sample Line Repeat : Sample Line: Ledgers[Line : Sample Line] Fields : Sample Fld1, Sample Fld2, Sample Fld3 [Field : Sample Fld1] Use : Name Field Set as : $Name [Field : Sample Fld2] Use : Amount Field Set as : $Closing Balance [Field : Sample Fld3] Use : Amount Field Set as : $PClosing Balance Sample Request Format XML file to fetch the internal methods an d Compute method: <ENVELOPE> <HEADER> <VERSION>1</VERSION> <TALLYREQUEST>EXPORT</TALLYREQUEST> <TYPE>COLLECTION</TYPE><ID>Ledger</ID> </HEADER>
TDL_Reference_Manual.pdf
Writing Remote Compliant TDL Reports 18 3 <BODY> <DESC> <STATICVARIABLES> <SVEXPORTFORMAT>Binary XML</SVEXPORTFORMAT><SVCURRENTCOMPANYTYPE="String">Demo Company</SVCURRENTCOMPANY> <SVCURRENTDATE TYPE="Date">20-Dec-2008</SVCURRENTDATE> <SVFROMDATE TYPE="Date">1-Apr-2008</SVFROMDATE> <SVTODATE TYPE="Date">31-Mar-2009</SVTODATE> <SVCURRENTKBLANGUAGEID TYPE="Number">1033 </SVCURRENTKBLANGUAGEID></STATICVARIABLES> <TDL> <TDLMESSAGE> <COLLECTION NAME="Ledger" ISMODIFY="No" ISFIXED="No" ISINITIALIZE="Yes" ISOPTION="No" ISINTERNAL="No"> <TYPE>Ledger</TYPE> <METHOD>PClosing Balance:$Closing Balance:Group:$Paren </METHOD> <NATIVEMETHOD>Name</NATIVEMETHOD><NATIVEMETHOD>Parent</NATIVEMETHOD> <NATIVEMETHOD>Closing Balance</NATIVEMETHOD> </COLLECTION> </TDLMESSAGE> </TDL> </DESC> </BODY> <ENVELOPE>
TDL_Reference_Manual.pdf
Writing Remote Com pliant TDL Reports 184 6. 2 Report Level Enhancements Fetching the Object When multiple methods of a single Object are required for a Rep ort, then that Object can be fetched at Report level. For this purpose, new Report attribute 'Fetch Object ' has been introduced. Internally fetching an object will generate an XML fragment which will be sent to the Ta l l y Server as a request. Syntax Fetch Object : <Object Type> : <Object Name>:<Method Name1 + [,<Method Name 2>... ] Where, <Object T ype> denotes the type of the Object. <Object Name> denotes the name of the Object. <Method Name 1> denotes the method to be fetched. Example: Pre fetching Ledger Object with methods 'Name' & 'Clos ing Balance' [Report : Simple Report] Fetch Object : Ledger : Ledger Name : Name, Parent,Closing Balance In this code snippet, Ledger Name is the variable which stores the name of the Ledger Object whose methods need to be fetched at the Report. Sample Request Format XML file to fetch the object: <ENVELOPE> <HEADER> <VERSION>1</VERSION><TALLYREQUEST>EXPORT</TALLYREQUEST> <TYPE>OBJECT</TYPE> <SUBTYPE>Ledger</SUBTYPE><ID TYPE="Name">Cash</ID> </HEADER> <BODY> <DESC> <STATICVARIABLES> <SVCURRENTCOMPANY>Demo Company</SVCURRENTCOMPANY> <SVEXPORTFORMAT>Binary XML</SVEXPORTFORMAT>
TDL_Reference_Manual.pdf
Writing Remote Compliant TDL Reports 18 5 <SVFROMDATE TYPE="Date">1-Apr-2008</SVFROMDATE> <SVTODATE TYPE="Date">31-Mar-2009</SVTODATE> <SVCURRENTDATE TYPE="Date">1-May-2008</SVCURRENTDATE> <SVVALUATIONMETHOD TYPE="String"></SVVALUATIONMETHOD> <SVBUDGET TYPE="String"> </SVBUDGET> <SVCURRENTKBLANGUAGEIDTYPE="Number">1033 </SVCURRENTKBLANGUAGEID><SVCURRENTUILANGUAGEIDTYPE="Number">1033 </SVCURRENTUILANGUAGEID> </STATICVARIABLES><FETCHLIST> <FETCH>Name</FETCH> <FETCH>Parent</FETCH><FETCH>Closing Balance</FETCH> </FETCHLIST> </DESC> </BODY> </ENVELOPE> Pre Fetching the Object There are some scenarios in which it is required to set the val ues of variables according to the data fetched along with the object. At the report level, the 'S et' attribute for changing variable value takes precedence and 'Fetch Object' is evaluated later. In those cases, fetching the object first becomes mandatory. For this purpose, a new attribute ' Pre Fetch Object ' has been introduced, which will be evaluated before the 'Set' attribute. Syntax Pre Fetch Object : <Object Type> : <Object Name> : <Method Name1 + [,<Method Name 2>... ] Where, <Object T ype> denotes the type of the Object. <Object Name> denotes the name of the object, and <Method Name 1> denotes the method to be pre-fetched.
TDL_Reference_Manual.pdf
Writing Remote Com pliant TDL Reports 186 Example: [Report : Simple Report] Set : Ledger Name : “Cash” Pre Fetch Object : Ledger : Ledger Name : Last Voucher Date Set : SVFrom Date : $Last Voucher Date : Ledger : ##Ledger Name In this code snippet, variables are set once, and then the Pre Fetch Object is done, and once again the variables are set to make sure that the values of the varia bles which were dependent on the object, will set now. Pre fetching the Collection When the same collection is used in the Report either for repea ting the line over its objects or multiple functions using the same, then a Collection of those o bjects can be pre fetched at the Report level. A new Report attribute ' Fetch Collection ' is introduced to pre fetch a Collection. Syntax Fetch Collection : <Collection 1> [,<Collection 2>..] Where, <Collection 1> is the collection whose objects need to be pre fetched at Repor t. Example: Pre fetching Ledger collection [Report : Sample Report] Fetch Collection : Ledger Local : Collection : Fetch : Ledger In this code snippet, Ledger Collection is pre-fetched. Sample Request Format XML file to fetch the object: <ENVELOPE> <HEADER> <VERSION>1</VERSION> <TALLYREQUEST>EXPORT</TALLYREQUEST> <TYPE>COLLECTION</TYPE><ID>All Party</ID> </HEADER> <BODY> <DESC> <STATICVARIABLES>
TDL_Reference_Manual.pdf
Writing Remote Compliant TDL Reports 18 7 <SVEXPORTFORMAT>Binary XML</SVEXPORTFORMAT> <SVUSEPARMLIST>No</SVUSEPARMLIST> <SVFORTABLE>No</SVFORTABLE> <SVCURRENTCOMPANY TYPE="String">Remote Vivek</SVCURRENTCOMPANY><SVCURRENTDATE TYPE="Date">2-May-2008</SVCURRENTDATE> <SVFROMDATE TYPE="Date">1-Apr-2008</SVFROMDATE> <SVTODATE TYPE="Date">31-Mar-2009</SVTODATE> <SVVALUATIONMETHOD TYPE="String"></SVVALUATIONMETHOD> <SVBUDGET TYPE="String"></SVBUDGET> </STATICVARIABLES> <TDL> <TDLMESSAGE> <COLLECTION NAME="All Party" ISMODIFY="No" ISFIXED="No" ISINITIALIZE="Yes" ISOPTION="No" ISINTERNAL="No"> <TYPE>Ledger</TYPE> <BELONGSTO>Yes</BELONGSTO><CHILDOF>$$Group Sundry Debtors</CHILDOF><NATIVEMETHOD>Opening Balance</NATIVEMETHOD> <NATIVEMETHOD>Closing Balance</NATIVEMETHOD> </COLLECTION></TDLMESSAGE> </TDL> </DESC> </BODY> </ENVELOPE>
TDL_Reference_Manual.pdf
Writing Remote Com pliant TDL Reports 188 6. 3 Function on Request Functions in TDL are defined and provided by the platform. A TD L programmer can only call a function. Now in client/server environment, functions can be ev aluated by either the sever or the client or both the client and the server. Based on this information, functions can be classified as follo ws: 1. Evaluated at client side 2. Evaluated at server side 3. Hybrid Evaluated at client side These are the functions which wil l be evaluated at the client s ide. For this, no server request is required from the client. If these functions require any parame ter as data, then required data needs to be fetched from the server before the function is call ed. Example: $$Key Explode, $$Explode Level, $$Line, etc., are the functions w hich do not require any parameter from the T ally server and are executed at the T ally c lient. Evaluated at server side These are the functions which will be evaluated at the server s ide. For each call of a function, a request will be sent to the server, along with the parameters. Example: $$Num Stock Items, $$Num Ledgers, etc., are the functions which wi ll be executed at the server side. Sample Request Format XML file for Function Call: <ENVELOPE> <HEADER> <VERSION>1</VERSION> <TALLYREQUEST>EXPORT</TALLYREQUEST> <TYPE>FUNCTION</TYPE><ID>$$Num Ledgers</ID> </HEADER> <BODY> <DESC> <STATICVARIABLES> <SVCURRENTCOMPANY>Demo Company</SVCURRENTCOMPANY> <SVEXPORTFORMAT>Binary XML</SVEXPORTFORMAT>
TDL_Reference_Manual.pdf
Writing Remote Compliant TDL Reports 18 9 <SVFROMDATE TYPE="Date">1-Apr-2008</SVFROMDATE> <SVTODATE TYPE="Date">31-Mar-2009</SVTODATE> <SVCURRENTDATE TYPE="Date">1-May-2008</SVCURRENTDATE> <SVCURRENTKBLANGUAGEID TYPE="Number">1033</SVCURRENTKBLANGUAGEID> <SVCURRENTUILANGUAGEID TYPE="Number">1033</SVCURRENTUILANGUAGEID> </STATICVARIABLES> </DESC> </BODY> </ENVELOPE> Hybrid These are the functions which will be executed on either the cl ient or the server side based on the availability of the data. Example: $$Is Sales, $$Coll Amt T otal, $$Fil ter Amt T otal, etc., are the func tions which will be executed at the server or client side, based on the availability of data. Server side execution $$Filter Amt Total : $Opening Balance : Ledgers : My Filter Since Ledger Collection is available on the sever, the function $$Filter Amt T otal will be executed at the Server end. Client side execution $$Filter Amt Total : $Amount : Ledger Entries : My Filter 'Ledger Entries' collection is available inside the 'Voucher' O bject. So, the required Voucher Object needs to be fetched to the Client before the function is executed. Once the Voucher is brought to the client, the function will be executed on the cli ent side, since it is assumed to be executed in the Voucher context. 6. 4 Action Enhancements The Action “ Modify Object ” is executed in the Display mode of any report. This action ca n be executed at the client's end to modify any object present on th e Server Company. For details on the usage of this action, please refer to 'TDL Enhancements for T ally. ERP 9”. Syntax Action : Modify Object : <Primary Object Spec>. <Sub Object Path Spec> + . Method-Name : value>[,Method Name: <value>,... ] + [,<Sub Object Path Spec>. Method Name:<value>,..... ]
TDL_Reference_Manual.pdf
Writing Remote Com pliant TDL Reports 190 Where, <Primary Object Spec> can be (<Primary Object Type Keyword>, <Primary Object Identifi er Formula>). <Sub Object Path Spec> is given as Collection Name [<Index Formula>, [<Condition>]] <Method Name> refers to the name of the method in the specified path. <Index Formula> should return a number which acts as a position specifier in th e Collection of Objects satisfying the given <condition>. Sample Request Format XML file for Modifying 'Ledger' Object: <ENVELOPE> <HEADER> <VERSION>1</VERSION> <TALLYREQUEST>IMPORT</TALLYREQUEST> <TYPE>DATA</TYPE><SUBTYPE>Ledger</SUBTYPE> <ID>All Masters</ID> </HEADER><BODY> <DESC> <STATICVARIABLES> <SVCURRENTCOMPANY>Demo Company</SVCURRENTCOMPANY> </STATICVARIABLES> </DESC><TALLYMESSAGE> <LEDGER NAME="Customer 1" RESERVEDNAME=""> <ADDRESS. LIST TYPE="String"><ADDRESS>Abc</ADDRESS><ADDRESS>Def</ADDRESS> </ADDRESS. LIST> <MAILINGNAME. LIST TYPE="String"><MAILINGNAME>Customer 1</MAILINGNAME>
TDL_Reference_Manual.pdf
Writing Remote Compliant TDL Reports 19 1 </MAILINGNAME. LIST> <ALTEREDON>20090112</ALTEREDON> <NAME TYPE="String">Customer 1</NAME> <CURRENCYNAME>Rs. </CURRENCYNAME><PINCODE>560001</PINCODE> <PARENT>Sundry Creditors</PARENT> <ISDEEMEDPOSITIVE TYPE="Logical">Yes</ISDEEMEDPOSITIVE> <SORTPOSITION> 1000</SORTPOSITION> <OPENINGBALANCE>1. 00</OPENINGBALANCE> <LANGUAGENAME. LIST><NAME. LIST TYPE="String"> <NAME>Customer 1</NAME> <NAME>Alias</NAME></NAME. LIST> <LANGUAGEID> 1033</LANGUAGEID> </LANGUAGENAME. LIST> </LEDGER> </TALLYMESSAGE> </BODY> </ENVELOPE> 7. Writing Remote Compliant TDL Reports TDL programmer can optimize the performance of the Remote compl iant TDL by minimizing the server request calls. Mentioned below are the guidelines to optimize the Remote Compl iant TDL Reports. 7. 1 Fetching the single Object When an entire Report requires multiple methods of a single Obj ect, then the Object can be pre-fetched with the required methods. In this approach, only o ne server call is made to fetch all the required methods.
TDL_Reference_Manual.pdf