toggle button - active/inactive

Discussion in 'Tally Developer' started by software tech, May 11, 2021.

    
  1. software tech

    software tech New Member


    Hello all,
    I had a button in a report, I want to make the button active only when the selected lines are > 0 otherwise inactive.
    How can I achieve this behavior?
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    $$NumItems:CollectionName > 0
     


  3. software tech

    software tech New Member


    I tried that, but it is not refreshing/updating the state of the button
    By default, it becoming inactive
    it's not becoming active even I select the lines.

    Any suggestions will be helpfull.

    Code:
    [Button:SendButton]
    title:"Send"
    Key: CTRL+D
    Action:call:sendfunction
    inactive:NOT ($$NumItems:CurrentSelection  > 0)
    
    [Collection:CurrentSelection]
    DataSource:Report:SelectedLines
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Your Collection is still EMPTY.......

    Please study...... [Collection: GSTVchRptSelMstIdsSrc] in Developer........
    -- how it becomes a source in another Collection and then how the Function calls for it..........

    Above will help you in understanding and structuring your code properly.
     


  5. sattam

    sattam Active Member


    [Button:SendButton]
    title:"Send"
    Key: CTRL+D
    Action:call:sendfunction
    Inactive : $$NumLinesInScope = 0
     
    software tech and love like this.


  6. software tech

    software tech New Member


    Thanks, its working as I expected.
     


Share This Page