How can i generate a serial number in a form like voucher no. if i m making and udf form for registration
If you want Auto increment of Number in your UDF field available in Voucher Form, try this [Field : Your Field] Set As : @@CurrentSerialNumber [System : Formulae] LastSerialNumber : $$CollectionField:$UDFofYourField@LastItem:HPCollection ;; your collection name CurrentSerialNumber: $$Number@LastSerialNumber + 1 [Collection: HPCollection] ;; your collection Type : Voucher Regards H V Patel
Its not working the number is not been incremented if i want this in ledger before name for its uniqueness than
;;for stock items auto part number creation [Collection:sitems] Type: stock item Fetch: name,MAILINGNAME,sprifixname,sbatchname ;; Sort : @@Default : $sbatchname Compute: vsbatchname:$$Number:$sbatchname + 1 Sort : Default : $$Number:$sbatchname Format:$vsbatchname,10 [#field : STKI PartNo] Set Always: Yes ;; Set as:$$String$$Number:$$CollectionField:$sbatchname:Last:sitems) ;;Set as: if ($$Line=1) and not $$InEditMode then @all else "" allcl1 + ($$Stringcl2) cl1:$$LocaleString:#STKIsprefix + cl2$$Number@calc + 1)) calc:$$FilterValue:$sbatchname:sitems:Last:IsCurrSTKItemName ;;; ($$Number:$lastreadingnos+1);;:stockitem:$stockitemname Skip:$$InCreateMode;; ($$Line=1) Set By Condition$$Line=1) and $$InCreateMode: @all ;[System: Formulae] ; IsSameItemName : $StockItemName = $$Owner:$StockItemName [#Part: STKI Basic Features] Add: Part: After: STKI Batch:sprefix [Part: sprefix] Line:stkisprefix [Line: STKI sprefix] Fields : Medium Prompt, STKI sprefix,stkialias Local : Field : Medium Prompt : Set as : $$LocaleString:"Prifix Details:" Space Top : 0.5 [Field: STKI sprefix] Use : short name Field Width : @@NumberWidth Set as : " " Storage: sprifixname [Field: stkialias] Use: number field Set as: $MAILINGNAME Storage: sbatchname Set Always: Yes ;; Set as:$$CollectionFieldcalc:1:sitems Set ascalc+1 calc:$$FilterValue:$sbatchname:sitems:Last:IsCurrSTKItemName Invisible:Yes [System: udf] sprifixname: String:201 sbatchname : Number:202