Hello Experts I have User Defined Field in Sales Voucher, Entering numbers, for example 15-05-12 1st voucher = 25 16-05-12 2nd voucher = 39 17-05-12 3rd voucher = 1000 01-05-12 4th voucher = 45 Now i want to get value of previous/last voucher (4th voucher = 45+1) in next 5th voucher, means 02-05-12 5th voucher = 46 Using below i am getting last value + 1 that is 1000+1, i need 45+1 [System: UDF] storeBillRangefrom: String: 1029 [Field : Billrangefrom] Use : Name Field Storage: storeBillrangefrom Set As : $CurrentBillRangefrom Width : 10 [Collection : HPCollection] Type : Voucher Filter : IsSales [System : Formula] LastBillRangefrom : $$CollectionField:$storeBillRangeto@LastItem:HPCollection CurrentBillRangefrom : $$Number@LastBillRangefrom + 1
[Collection : HPCollection] Type : Voucher Filter : IsSales Sort : @@Increaing : $MasterId ;; Now all the sales voucher will sort on Master Id instead of Date/VoucherNumber