please help me to Save Collection Data into Aggregate UDF I Wrote Code but something wrong Thank You Sir [System: UDF] MyUdfStkMasterTBL : Aggregate : 20010 MyUdfStkItemName : String : 20011 [#Menu: Accounts Info.] Add: Item :Before @locQuit:Stock Item Master:Alter:Stock Detail Master Add: Item :Before @locQuit:Import Stock Item Master:Call : TestFunction123 [Report:Stock Detail Master] Form: STForm Title: "Stock Detail Master" Object:company [Form: STForm] Width: 100% Screen Height: 100% Screen Background: FormClr Part:STPart [Part:STPart ] Line: STLineTitle,STLine Repeat:STLine:MyUdfStkMasterTBL Break on : $$IsEmpty:$MyUdfStkItemName Scroll: Vertical [Line:STLineTitle] Fields : TLSTSrNoFld, TLSTNameFld Local : Field : Default : Delete : Border [Line:STLine] Fields : Multi SNo, STNameFld Local : Field : Default : Delete : Border [Field: TLSTSrNoFld] Use: Name Field Set as: "Sr" Width: 4 Align: Center Color: BLUE [Field: TLSTNameFld] Use: Name Field Set as: "Stock Name" Width: 30 Align: Left Color: BLUE [Field: STNameFld] Use : Name Field Storage : MyUdfStkItemName Unique : Yes Width: 30 [Collection : CollMaster123] Type : Vouchers : Stock Item Child Of : $$BaseOwner:#VchStockItem [Collection : CollDetails123] Source Collection : CollMaster123 Walk : Inventory Entries By : StockItemName : $StockItemName Fetch :StockItemName [Function : TestFunction123] 10 : WALK COLLECTION : CollDetails123 20 : INSERT COLLECTION OBJECT : MyUdfStkMasterTBL 30 : Set Target : MyUdfStkMasterTBL 40 : Set Value : MyUdfStkItemName : $$String:$StockItemName 60 : SET TARGET : .. 70 : END Walk 80 : Accept Create 90 : Return 100: MSGBOX : "Status" : "Stock Item-Type Imported"
Your function order was wrong.... here is the correct function..... [Function : TestFunction123] 10 : WALK COLLECTION : CollDetails123 20 : INSERT COLLECTION OBJECT : MyUdfStkMasterTBL 30 : Set Target : MyUdfStkMasterTBL 40 : Set Value : MyUdfStkItemName : $$String:$StockItemName 60 : SET TARGET : .. 70 : Create Target 80 : END Walk 100: MSGBOX : "Status" : "Stock Item-Type Imported" 110 : Return
If the function of this FUNCTION is to create StockItem, why is your collection based on VOUCHERS ???? If in Vocuhers, means Stock Item already exists, else you would not be able to pass any entries, THEN WHAT exactly is being imported???
thank you sir for reply i have created udf field stockcolor in sales voucher after stockitem i want to save stockitem and stockcolor to this Aggregate field from all inventory entries [System: UDF] MyUdfStkMasterTBL : Aggregate : 20010 MyUdfStkItemName : String : 20011 MyUdfStkItemColor : String : 20012 [#Menu: Accounts Info.] Add: Item :Before @locQuit:Stock Item Master:Alter:Stock Detail Master Add: Item :Before @locQuit:Import Stock Item Master:Call : TestFunction123 [Report:Stock Detail Master] Form: STForm Title: "Stock Detail Master" Object:company [Form: STForm] Width: 100% Screen Height: 100% Screen Background: FormClr Part:STPart [Part:STPart ] Line: STLineTitle,STLine Repeat:STLine:MyUdfStkMasterTBL Break on : $$IsEmpty:$MyUdfStkItemName Scroll: Vertical [Line:STLineTitle] Fields : TLSTSrNoFld, TLSTNameFld,TLSTColor Local : Field : Default : Delete : Border [Line:STLine] Fields : Multi SNo, STNameFld,STColorFld Local : Field : Default : Delete : Border [Field: TLSTSrNoFld] Use: Name Field Set as: "Sr" Width: 4 Align: Center Color: BLUE [Field: TLSTNameFld] Use: Name Field Set as: "Stock Name" Width: 30 Align: Left Color: BLUE [Field: STNameFld] Use : Name Field Storage : MyUdfStkItemName Unique : Yes Width: 30 [Field: TLSTColor] Use: Name Field Set as: "Stock Color" Width: 30 Align: Left Color: BLUE [Field: STColorFld] Use : Name Field Storage : MyUdfStkItemColor Unique : Yes Width: 30 [Collection : CollMaster123] Type : Vouchers : Stock Item Child Of : $$BaseOwner:#VchStockItem [Collection : CollDetails123] Source Collection : CollMaster123 Walk : Inventory Entries By : StockItemName : $StockItemName By : MyStockColor : $MyStockColor Fetch :StockItemName,MyStockColor [Function : TestFunction123] 10 : WALK COLLECTION : CollDetails123 20 : INSERT COLLECTION OBJECT : MyUdfStkMasterTBL 30 : Set Target : MyUdfStkMasterTBL 40 : Set Value : MyUdfStkItemName : $$String:$StockItemName 50 : Set Value : MyUdfStkItemColor : $$String:$MyStockColor 60 : SET TARGET : .. 70 : END Walk 80 : Accept Create 90 : Return 100: MSGBOX : "Status" : "Stock Item-Type Imported"