This action sets the target object with the Object Specification. If no object specification is given,
then the current object will be set as the target object.
Syntax
SET TARGET:
Where,
Example:
01 : SET TARGET : Group
This sets the ‘Group’ Object as the Target Object. Later, by using other methods of this, the target
object can be set and saved to the Tally DB.
4.2.5 Usage of Object manipulation Actions:
Duplicating all payment Vouchers
[Function : DuplicatePaymentVouchers]
;;Process for each Payment Voucher
01 : WALK COLLECTION : My Vouchers
;; Create new Voucher Object as Target Object
02 : NEW OBJECT : Voucher
;;For New Object, set methods from the First Object of the Walk Collection, i.e., from the Current Object
03 : SET VALUE : Date : $Date
04 : SET VALUE : VoucherTypeName : $VoucherTypeName
05 : S ET VALUE : Narration : $Narration + " Duplicated"
;; Walk over Ledger Entries of the current Object
05a: WALK COLLECTION : LedgerEntries
;;Insert Collection Object to the Target Object and make it the present Target Object
06 : INSERT COLLECTION OBJECT : Ledger Entries
;;Set the Values of the Target Object’s Method from Current Objects Methods
07 : SET VALUE : Ledger Name : $LedgerName
258
08 : SET VALUE : IsDeemedPositive : $IsDeemedPositive
09 : SET VALUE : Amount : $Amount
;;Set the Voucher Object as Target, (which is 1 level up in the hierarchy) as Voucher is already having
;;Object specification
10 : SET TARGET : ..
11 : END WALK
;;Save the Duplicated Voucher to the DB.
15 : CREATE TARGET
16 : ENDWALK
17 : RETURN
then the current object will be set as the target object.
Syntax
SET TARGET:
Where,
Example:
01 : SET TARGET : Group
This sets the ‘Group’ Object as the Target Object. Later, by using other methods of this, the target
object can be set and saved to the Tally DB.
4.2.5 Usage of Object manipulation Actions:
Duplicating all payment Vouchers
[Function : DuplicatePaymentVouchers]
;;Process for each Payment Voucher
01 : WALK COLLECTION : My Vouchers
;; Create new Voucher Object as Target Object
02 : NEW OBJECT : Voucher
;;For New Object, set methods from the First Object of the Walk Collection, i.e., from the Current Object
03 : SET VALUE : Date : $Date
04 : SET VALUE : VoucherTypeName : $VoucherTypeName
05 : S ET VALUE : Narration : $Narration + " Duplicated"
;; Walk over Ledger Entries of the current Object
05a: WALK COLLECTION : LedgerEntries
;;Insert Collection Object to the Target Object and make it the present Target Object
06 : INSERT COLLECTION OBJECT : Ledger Entries
;;Set the Values of the Target Object’s Method from Current Objects Methods
07 : SET VALUE : Ledger Name : $LedgerName
258
08 : SET VALUE : IsDeemedPositive : $IsDeemedPositive
09 : SET VALUE : Amount : $Amount
;;Set the Voucher Object as Target, (which is 1 level up in the hierarchy) as Voucher is already having
;;Object specification
10 : SET TARGET : ..
11 : END WALK
;;Save the Duplicated Voucher to the DB.
15 : CREATE TARGET
16 : ENDWALK
17 : RETURN
Skip to main content