Dear Admin and All I Need Fetch mu UDF Last Value in Splitted Company like BatchName Please Provide Sampl Code
Already in this forum. Following are the steps : 1) In the Form Split Company, add the event On : Form Accept to invoke a User Defined Function. 2) Write a User Defined Function to a) Walk over the Objects of the Source Company (Unsplit Source) b) Gather the Closing UDF values into the List Variable c) Walk over the Objects of the Source Company again d) Switch the current company to the Split Company (Subsequent Year Company) and set it as Target for updating and saving the UDF Value. e) Set the UDF value from List Variable. f) Save the Target Company Object. g) Switch the Company back to Source Company.
[#Report: Split Company] Local : Form : Split Company: On : Form Accept : Yes : Form Accept Local : Form : Split Company: On : Form Accept : Yes : Call : DSDSplitMainCMPFunc:#CMPAction@DSDSplitCMP [System : Formula] DSDSplitCMP : ($$Sprintf@CmpSplitYearFormat:#CMPAction@CmpSplitDate) [Function : DSDSplitMainCMPFunc] Parameter : Old Company : String Parameter : New Company : String 001 : CALL : DSDSplitCMPFunc:##OldCompany:##NewCompany [FunctionSDSplitCMPFunc] Parameter : NewCompany C1 : String Parameter : NewCompany C2 : String Variable : vsItemName : String Variable : Counter : Number : 1 01 : SET : SVCurrent Company : ##NewCompanyC1 02 : WALK COLLECTION : DSD StockItems 03 : SET : vsItemName :$Name 04 : SET : SVCurrent Company : ##NewCompanyC2 05 : NEW OBJECT : StockItem : $Name : Yes 06 : SET : SVCurrent Company : ##NewCompanyC1 07 : IF : Not $$IsEmpty:$ClosingBalance 08 : WHILE : ##Counter<=$$NumItems:BatchInGodownName;;DSDSTKIBatchAllocattions 09 : WALK COLLECTION : BATCHALLOCATIONS 10 : SET TARGET : BATCHALLOCATIONS[##Counter] ;; 11 : SET VALUE : STKALLOCNum : $$CollectionField:$STKALLOCNum:##CounterSDSTKIBatchAllocattions ;;12: enginno 13: SET VALUE : enginno : $$CollectionField:$enginno:##Counter:BatchInGodownName;;DSDSTKIBatchAllocattions 14: SET VALUE : chasisno : $$CollectionField:$chasisno:##Counter:BatchInGodownName;;DSDSTKIBatchAllocattions 15: SET VALUE : itemcolor : $$CollectionField:$itemcolor:##Counter:BatchInGodownName;;DSDSTKIBatchAllocattions 16: SET VALUE : skucode : $$CollectionField:$skucode:##Counter:BatchInGodownName;;DSDSTKIBatchAllocattions 17 : SET TARGET : .. 18 : END WALK 19 : INC : Counter 20 : END WHILE 21 : End If 22 : SET : SVCurrent Company : ##NewCompanyC2 23 : Accept Alter 24 : SET : SVCurrent Company : ##NewCompanyC1 25 : END WALK [Collection : DSD StockItems] Type : StockItem Filter : NotEmptyClBalance BelongsTo : Yes Format : $Name,20 Format : $ClosingBalance,10 Fetch : Name,ClosingBalance Fetch: GodownName, BatchName, ClosingBalance, Rate, ClosingValue,name,enginno,chasisno,itemcolor,skucode [System : Formula] NotEmptyClBalance : Not $$IsEmpty:$ClosingBalance STKI Split Filter : $Name=##vsItemName [Collection: DSD STKI Split] Type : Stock Item Filter : STKI Split Filter [Collection: DSD STKI Batch Allocattions] Source Collection : DSD STKI Split Walk : Batch Allocations Fetch : Batch Name,skucode,enginno,chasisno,itemcolor ;; End-Of File [#Collection:BatchInGodownName] add :Fetch: name,enginno,chasisno,itemcolor,skucode