How To Fetch UDF Value in Next Year

Discussion in 'Tally Developer' started by dhanapal, Oct 17, 2013.

    
  1. dhanapal

    dhanapal New Member


    Dear Admin and All

    I Need Fetch mu UDF Last Value in Splitted Company like BatchName


    Please Provide Sampl Code
     


  2. Maulik Patel

    Maulik Patel Active Member


    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.
     
    SINTO PARAVA and Pritam Krishna like this.


  3. dhanapal

    dhanapal New Member


    I need Sample Code Sir,

    Because The idea is not Undertandable for me.
     


  4. dhanapal

    dhanapal New Member


    Dear Admin sir,

    Please help the Issue .
     


  5. SINTO PARAVA

    SINTO PARAVA Member


    Please help
    need Sample Code of Split Company
     


  6. SINTO PARAVA

    SINTO PARAVA Member


    [#Report: Split Company]
    Local : Form : Split Company: On : Form Accept : Yes : Form Accept
    Local : Form : Split Company: On : Form Accept : Yes : Call : DSDSplitMainCMPFunc:#CMPAction:mad:@DSDSplitCMP

    [System : Formula]
    DSDSplitCMP : ($$Sprintf:mad:@CmpSplitYearFormat:#CMPAction:mad:@CmpSplitDate)


    [Function : DSDSplitMainCMPFunc]
    Parameter : Old Company : String
    Parameter : New Company : String

    001 : CALL : DSDSplitCMPFunc:##OldCompany:##NewCompany


    [Function:DSDSplitCMPFunc]
    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:##Counter:DSDSTKIBatchAllocattions
    ;;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
     


  7. dipika

    dipika New Member


    but it doesnt work
     


Share This Page