;; Sri Ganeshji : Sri Balaji : Sri Pitreshwarji : Sri Durgaji : Sri Venkateshwara /* Objective(s) - This program illustrates the use of following attributes of Field Act on Table Element Cyclic Behavior/Process Change Table Set as Set Always - This program illustrates the use of following attributes of Object Action Behave As */ [#Menu: Gateway of Tally] Add: Item: ($$LocaleString:"Cyclic Table") : Alter: TSPL Cyclic Table [Report: TSPL Cyclic Table] [Form: TSPL Cyclic Table] Part : TSPL Cyclic Table Width : 40% Screen Height : 10% Screen [Part: TSPL Cyclic Table] Line : TSPL Cyclic Table Space Left : .5 [Line: TSPL Cyclic Table] Field : Medium Prompt, TSPLCyclic Table, Short Prompt, TSPL Parent Field Local : Field : Medium Prompt : Info : "Stock Item" Local : Field : Short Prompt : Info : "Parent" [Field : TSPLCyclic Table] Use : Name Field Table : TSPLList of Stock Groups, TSPL Primary Show Table : Always and Never Hide Skip Action : Yes Act On Table Element : Yes : Execute Obj Actions : TSPLChildStockItems ;;When any item from the table is selected the action corresponding to the label TSPLChildStockItems in the selected object type will be executed which in this case is stock group Act On Table Element : ($$CurrentTableObj:$Name = $$Sysname:Back) : Execute Obj Actions : Table Action ;;When back is selected, action corresponding to lable TableAction is executed from the object definition ObjAlterCycleBack in collection CycleBackAction.This is to go back to stock group table from stock item table Process Change Table : Yes ;;Indicates the table exhibits cyclic behavior [Field: TSPL Parent Field] Use : NameField Set as : $$Table:TSPLCyclicTable:$Parent ;;The Parent of the selected stock item in the stock item field is set in this field Set Always : Yes ;;This field is refreshed every time stockitem is selected in stock item field Read Only : Yes ;;The field is in read only mode, but cursor goes to the field ;;Stock Group collection shown as the initial table [Collection : TSPLList of Stock Groups] Title : "List of Stock Group" Type : Stock Group Format : $Name,20 Align : Center ;;Primary sysname shown as part of table to select items under primary stock group [Collection: TSPL Primary] Object : TSPL Primary Object Format : $Name ClientOnly : Yes ;;Object has actions to set the selected stock group(Primary) to a variable and change table to stock items of primary stock group along with Back action object [Object: TSPL Primary Object] Name : $$SysName:Primary Action : TSPLChildStockItems : Set : TSPLStockGroupName : $$CurrentTableObj:$Name Action : TSPLChildStockItems : Change Table : TSPLChildStockItemsCollection, TSPLCycleBack Action: Yes ;;Object has actions to set the selected stock group to a variable and change table to stock items of selected stock group along with Back action object [#Object: Stock Group] Action : TSPLChildStockItems : Set : TSPLStockGroupName : $$CurrentTableObj:$Name Action : TSPLChildStockItems : Change Table : TSPLChildStockItemsCollection, TSPLCycleBack Action: Yes ;;Back sysname shown as part of table to be able to go back to the stockgroup table [Collection: TSPL CycleBack Action] Object : TSPL Obj Alter Cycle Back Format : $Name Client Only : Yes ;;Object is defined as action object with a action statement that is used to cycle back to the previous table which is the stockgroup table [Object: TSPL Obj Alter Cycle Back] Name : $$SysName:Back Behave As : Action ;; Sets the object behaviour to action IsAlter : Yes Action : TableAction : Cycle Back ;;Action statement that calls the cycleback action to go to the previos table ;;Collection used as table to list stock items of selected stock group [Collection : TSPLChildStockItemsCollection] Title : "Stock Item of " + ##TSPLStockGroupName Sub Title : "Name", "Closing Value" Type : Stock Item Child Of : ##TSPLStockGroupName Align : Center Format : $Name,25 Format : $ClosingValue, 25 ;;variable that holds the selected stock group name [System: Variable] TSPLStockGroupName : "" [Variable: TSPLStockGroupName] Type : String ;;EOF