Tally Hangs wen i execute the form second time. plsss Help

Discussion in 'Tally Developer' started by Manoj Anandan, May 23, 2025.

  1. Manoj Anandan

    Manoj Anandan New Member


    But the program works as intented the first time



    [#Menu:Gateway of tally]
    Add:Key Item:pendL:L:Execute:mjpend

    [Report:mjpend]
    Auto:Yes
    Form:mjpend
    Full Screen:Yes

    [Form:mjpend]
    Part:mjpend
    Width:50 % page

    On:Form Accept:True:Call:pensav
    On:Form Accept:True:Form Accept
    [Part:mjpend]
    Lines:penl1,penl2,penl6,penl5,penl3,penl4
    Local:Style:DEFAULT:Height:36

    [Line:penl1]
    Fields:pendinfo,penddate
    Space Top:5 mms


    [Field:pendinfo]
    Style : Normal Bold
    ;;FullWidth : Yes
    ;;Border : Thin Bottom
    Align : Right
    Skip : Yes
    Fixed : Yes
    Set as:"Date:"
    Width: 50 mms
    [Field:penddate]
    Use:short date field
    Fixed:Yes
    Skip:Yes
    Align:Right
    Set as:$$SysInfo:Systemdate
    Full Width:Yes
    [Line:penl2]
    Fields:cuin,cuna
    Space Top:5 mms
    [Field:cuin]
    Style : Normal Bold
    ;;FullWidth : Yes
    ;;Border : Thin Bottom
    Align : Right
    Skip : Yes
    Fixed : Yes
    Set as:"Name:"
    Width: 50 mms
    [Field:cuna]
    Use:name field
    Set Always : Yes
    Table : Party Ledgers Extract
    Show Table : Always
    Dynamic : ""
    Full Width:Yes
    [Line:penl3]
    Fields:adft,adf
    Space Top:5 mms
    [Field:adft]
    Style : Normal Bold
    ;;FullWidth : Yes
    ;;Border : Thin Bottom
    Align : Right
    Skip : Yes
    Fixed : Yes
    Set as:"Debit:"
    Width: 50 mms
    [Field:adf]
    Use:amount field
    Full Width:Yes
    Align:Left
    [Line:penl4]
    Fields:acft,acf
    Space Top:5 mms
    [Field:acft]
    Style : Normal Bold
    ;;FullWidth : Yes
    ;;Border : Thin Bottom
    Align : Right
    Skip : Yes
    Fixed : Yes
    Set as:"Credit:"
    Width: 50 mms
    [Field:acf]
    Use:amount field
    Full Width:Yes
    Align:Left
    Skip:if $$IsEmpty:#adf then no else yes
    [Line:penl5]
    Fields:pennt,penn
    Space Top:5 mms
    [Field:pennt]
    Style : Normal Bold
    Align : Right
    Skip : Yes
    Fixed : Yes
    Set as:"Narration:"
    Width: 50 mms
    [Field:penn]
    Use:Narration Field
    Full Width:Yes

    [Line:penl6]
    Fields:pencurt,pencur
    Space Top:5 mms
    [Field:pencurt]
    Style : Normal Bold
    Align : Right
    Skip : Yes
    Fixed : Yes
    Set as:"Balance:"
    Width: 50 mms

    [Field:pencur]
    Use:amount field
    Style : Normal Bold
    Align : Right
    Skip : Yes
    Fixed : Yes
    Set as:$closingbalance:Ledger:#cuna
    Format : "Symbol,DrCr"
    Set Always:Yes
    Width: 50 mms

    [Function:pensav]
    Variable:pet:Date
    Variable:pledname:String
    Variable:lclob:Amount
    Variable:pennar:String
    Variable:pendeb:Amount
    Variable:pencred:Amount
    Variable:temamt:Amount
    00:Set:pet:#penddate
    10:Set:pledname:#cuna
    20:Set:lclob:#pencur
    30:Set:pennar:#penn
    40:Set:pendeb:#adf
    50:Set:pencred:#acf
    60:Set:temamt:if $$IsEmpty:##pencred then ##pendeb else ##pencred
    110:Start Batch Post:50
    120:New Object:Voucher
    130:Set Value:Date:##pet
    140:Set Value:VoucherTypeName:"Journal"
    141:Set Value:Narration:##pennar
    ;;142:Msg Box:"1":"1"
    150: INSERT COLLECTION OBJECT : AllLedgerEntries
    160:Set Target:AllLedgerEntries[1]
    170:SET VALUE : Ledger Name :(If($$IsEmpty:##pencred) then $$String:##pledname else "##")
    180:SET VALUE : IsDeemedPositive : "Yes"
    190:SET VALUE : Amount : $$Negative:##temamt
    200 : SET TARGET : ..
    210 : SET VALUE : PersistedView : ##SVViewName
    ;;212:Msg Box:"2":"2"
    215:INSERT COLLECTION OBJECT : AllLedgerEntries
    220:Set Target:AllLedgerEntries[2]
    230:SET VALUE : Ledger Name :(If($$IsEmpty:##pencred) then "##" else $$String:##pledname )
    240:SET VALUE : IsDeemedPositive : "No"
    250:SET VALUE : Amount : ##temamt
    260 : SET TARGET : ..
    270 : SET VALUE : PersistedView : ##SVViewName
    ;;272:Msg Box:"3":"3"
    280 :CREATE TARGET
    290:End Batch Post
     


Share This Page