0% found this document useful (0 votes)
331 views

Walk Collection

This document discusses the Tally Development Language (TDL) and provides examples of using walk collections. The walk collection attribute is used to loop through collections of objects or list variables to update or retrieve data. For example, to access stock item quantities in vouchers, the voucher object is set and its inventory entries collection is walked. Walk collections are useful for developing upload utilities to transfer data from Excel to Tally. The code provided loops through a collection storing Excel data to update fields in the required Tally object. The final example shows a function that walks the list of stock items and sets the costing method of each to "FIFO Perpetual".

Uploaded by

Sushil Choudhary
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
331 views

Walk Collection

This document discusses the Tally Development Language (TDL) and provides examples of using walk collections. The walk collection attribute is used to loop through collections of objects or list variables to update or retrieve data. For example, to access stock item quantities in vouchers, the voucher object is set and its inventory entries collection is walked. Walk collections are useful for developing upload utilities to transfer data from Excel to Tally. The code provided loops through a collection storing Excel data to update fields in the required Tally object. The final example shows a function that walks the list of stock items and sets the costing method of each to "FIFO Perpetual".

Uploaded by

Sushil Choudhary
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

TALLY DEVELOPMENT LANGUAGE

(TDL)

Walk Collection:
This Loop attribute of the Function, this is mainly used to Update/get the data stored in the
collections of the Objects or List Variables e.g. Inventory entries of object Vouchers, Bill Allocations of
Object Ledger

Here Inventory entries is the collection of the Object Voucher, so if you want to access the data of Stock
Item Quantity in Voucher you have to first set the Object to that voucher than you have to walk on the
Inventory entries collection which have the method Billed Quantity.

Utility of Walk Collection:

This is used to develop the upload utility from excel to Tally data, where you have to Loop on the
collection of Variables storing the excel data to update data of the required Object

Code:

[Variable:ExcelBillbyBillData]
Variables:BillType,BillRefno,BillPartyName:String
Variable:BillDate:Date
Variable:BillCPeriod:Number
Variable:BillAmount:Amount

[Collection:ListExcelBillbyBillDataSrc]
Data Source : Variable : ExcelBillbyBillData

[Collection:ListExcelBillbyBillDataSumm]
Source Collection:ListExcelBillbyBillDataSrc
Fetch:BillType,BillRefno,BillPartyName
Fetch:BillDate,BillCPeriod
Fetch:BillAmount

[Collection:ListExcelBillbyBillDataagg] ;;Collection use in Walk Collection to Loop the no of Row in


Excel having the data of the Bill Allocations
Source Collection:ListExcelBillbyBillDataSumm
Fetch:BillType,BillRefno,BillPartyName
Fetch:BillDate,BillCPeriod
Fetch:BillAmount
By:grpBillPartyName:$BillPartyName
Aggr Compute:sumBillAmount:Sum:$BillAmount
[Collection:rtListExcelBillbyBillDataSumm]
Use:ListExcelBillbyBillDataSumm
;Fetch:BillType,BillRefno,BillPartyName
;Fetch:BillDate,BillCPeriod
;Fetch:BillAmount
Filter:forPartyName

[System:Formulae]
forPartyName:$BillPartyName=##prmBillPartyName ;##CurrentPartyName

[Function:ReadBillbyBillExcelData]
Variable : Row : Number
Variable : Last Status : String
List Variable : ExcelBillbyBillData
Variable : DesFilePath :String

00 : QUERY BOX : "Import Bill by Bill data ?" : Yes : No


10 : IF : $$LastResult
20 : OPEN FILE : @@ExcelFilePath : Excel : READ
30 : else
40 : Return
50 : End If
90 : SET : Row : 3
60 : START PROGRESS : ##Row : "Importing Bill by Bill data" : "Please Wait": "In Progress..."
100 : WHILE : NOT $$IsEmpty:($$FileReadCell:##Row:1)
;100a : Log:"come inside while loop"
110 : List Add Ex : ExcelBillbyBillData
130 : SET : ExcelBillbyBillData[$$LoopIndex].BillTyp:$$FileReadCell:##Row:1
140 : SET : ExcelBillbyBillData[$$LoopIndex].BillRefno: $$FileReadCell:##Row:2
120 : SET : ExcelBillbyBillData[$$LoopIndex].BillPartyName: $$FileReadCell:##Row:6
170 : SET : ExcelBillbyBillData[$$LoopIndex].BillDate : $$FileReadCell:##Row:3
160 : SET : ExcelBillbyBillData[$$LoopIndex].BillCPeriod : $$FileReadCell:##Row:5
150 : SET : ExcelBillbyBillData[$$LoopIndex].BillAmount : $$FileReadCell:##Row:8
320 : Increment : Row
340 : End While
350 : Close File
380 : WALK COLLECTION : ListExcelBillbyBillDataagg
381 : If:Not $$Isempty:$BillType
609 : Call: UpdateBillbyBilldata:$BillPartyName:$SumBillAmount:$BillType
610 : End If
900 : End Walk
[Function:UpdateBillbyBilldata]
Parameter:prmBillPartyName:String
Variable:CurrentPartyName:String
Parameter:parsumBillAmount:Amount
Parameter:ParBillType:String
Object:Ledger:##prmBillPartyName
01 : Set Object : (Ledger, ##prmBillPartyName).
02 : Set Target : (Ledger, ##prmBillPartyName).
02m : Set Value:OpeningBalance:##parsumBillAmount
03 : Walk Collection:rtListExcelBillbyBillDataSumm
03a : If:Not $$Isempty:$BillCPeriod
04 : Insert Collection Object:BillAllocations
04s : Set Target:BillAllocations
06 : Set Value: Name : $BillRefno
10 : Set Value: BillDate: $BillDate
11 : Set Value:BillCreditPeriod:($$DateRange:($$String:$BillCPeriod+"
days"):$BillDate:True)
12 : Set Value:OpeningBalance:$BillAmount
11s : Set Target:..
11a : End If
13 : End Walk
100 : Accept Alter

Code 2: Below code have the Function to update the Valuation method of Stock as “FIFO Perpetual”
[#Menu:GatewayofTally]
Add:Button:Change FIFO

[Button:Change FIFO]
Key:Alt+R
Action:Call:ChangeTOFIFOMethod

[Function:ChangeTOFIFOMethod]
00:Walk Collection:ListofStockITem
01:Set Object:(StockItem,$Name).
02:Set Target:(StockItem,$Name).
10:Set Value:CostingMethod:"FIFO Perpetual"
20:Alter Target
100:End Walk

You might also like