Running functions when creating new entries only

Discussion in 'Requests' started by torsky, May 11, 2022.

    
  1. torsky

    torsky New Member


    Dear sir/madam,

    Functions run automatically when creating a new ledger or altering existing using the following code:

    Code:
    [#Form: Ledger]
        Add : On : At End : Form Accept : Yes : CALL : somefn
        On: Form Accept:Yes: Form Accept
      
    [Function:somefn]
    However, I would like to know a way to call functions only when creating a new entry, not at the time of alteration.

    Please also let me know the wise versa condition, i.e., call functions at the time of alterations only and not when creating new entries.

    Thank you!
     


  2. balajimg

    balajimg Active Member


    [#Form: Ledger]
    Add : On : $$IncreateMode: Form Accept : Yes : CALL : somefn1
    Add : On : $$InAlterMode: Form Accept : Yes : CALL : somefn2
    On: Form Accept:Yes: Form Accept
     
    torsky likes this.


  3. torsky

    torsky New Member


    @balajimg Sir, there seems a syntax error

    [​IMG]
     


  4. balajimg

    balajimg Active Member


    [#Form: Ledger]
    Add : On : $$IncreateMode: CALL : somefn1
    Add : On : $$InAlterMode: CALL : somefn2
    On: Form Accept:Yes: Form Accept
     


  5. torsky

    torsky New Member


    [​IMG]

    Still an error
     


  6. balajimg

    balajimg Active Member


    [#Form: Ledger]
    Add : On : Form Accept : $$IncreateMode: CALL : somefn1
    Add : On : Form Accept :$$InAlterMode: CALL : somefn2
    On: Form Accept:Yes: Form Accept
     
    torsky likes this.


  7. balajimg

    balajimg Active Member


    spoon feeding is not the way...
    check syntax in default tally developer
    you'll get the idea
     
    torsky likes this.


  8. torsky

    torsky New Member


    Thank you Sir, it works.
     


  9. torsky

    torsky New Member


    Apologies, I will keep this in mind
     


Share This Page