Button to Toggle Show Either Debit or Credit Entries

Discussion in 'Tally Developer' started by psr, Sep 18, 2020.

    
  1. psr

    psr Member


    Dear Members,

    I want to have a button in ledger vouchers which displays Either "Debit Entries Only", " Credit Entries Only", "All Vouchers". I believe this can be done using a variable but I am unable to frame the logic and code. Please guide me

    [#Form: Default]
    Add: Button: DebitCredits

    [Button: DebitCredits]
    Title: "DebitCredit"
    Key: Alt + W
    Action: What Should be the action?

    Also How to paste the code within Tags in the forum?

    Thank you
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    1- Refer ONLY to FORM : :Ledger Vouchers instead of Default... so it is available only in Ledger.

    2 - Action : Set : {variableName} : "DefultValue" --- examine Report : Ledger Vouchers to find the variable name and its default value.

    3 - In the totle bar of this forum's message box, find INSERT then select Code and then paste your code.
     
    Jaydeep Shah likes this.


  3. psr

    psr Member


    Sir,

    I tried this way

    [#Form : Ledger Vouchers]
    add:button : Dbutton
    [button: Dbutton]
    Key : ctrl+t
    Title : "Debit-Entries"
    Action : Set: OnlyDrVouchers : Yes

    [#Form : Ledger Vouchers]
    add:button : Cbutton
    [button: Cbutton]
    Key : ctrl+Y
    Title : "Credit-Entries"
    Action : Set: OnlyCrVouchers : Yes

    How to Use a Single Button To Toggle between "Dr", "Cr,","All"?

    Thank you for the guidance

    I am still not able to find the Insert button to post the code.
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You cannot use single button for "3" ..... only....either this or that..........
     


  5. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Capture.PNG Here it is...........
     


  6. psr

    psr Member


    Sir,

    Then what modifications should be done to get either "Dr" or "Cr" . Once I Select "Cr" I am not able to get back to the Debit entries again later.
     


  7. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You will need to have a DUMMY refresh or refresh the data manually............
     


  8. kirandham

    kirandham New Member


    N
    no sir i think we can..
     


  9. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Dat good to know...... maybe I learn something new... :)
     


  10. Rubazi

    Rubazi New Member


    Use the below only:


    [#Form : Ledger Vouchers]
    add:button : Dbutton
    [button: Dbutton]
    Key : ctrl+t
    Title : "Debit-Entries"
    Action : Set: OnlyDrVouchers : Not ##OnlyDrVouchers
     


  11. kirandham

    kirandham New Member


    Wga
    What if we want to switch between DRentries and Creentries Using only 1 button?
    Possible to switch?
     


  12. Rubazi

    Rubazi New Member


    Just press and check, it is toggle button. only you need to change title using variable.
     
    psr likes this.


  13. psr

    psr Member


    Thank you
     


  14. SUSHIL SHARMA

    SUSHIL SHARMA Member


    MENE BHI TRY KIYA OR DR CR 2 BATTON BANAYE


    [#Form : Ledger Vouchers]
    add:button : Dbutton
    [button: Dbutton]
    Key : ctrl+t
    Title : "Debit-Entries"
    Action : Set: OnlyDrVouchers : Not ##OnlyDrVouchers

    [#Form : Ledger Vouchers]
    add:button : Cbutton
    [button: Cbutton]
    Key : ctrl+Y
    Title : "Credit-Entries"
    Action : Set: OnlyCrVouchers : Not ##OnlyCrVouchers
     


  15. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Bahut Badhiya......katrein raho ,,,kamaal
     


  16. kirandham

    kirandham New Member



    Acthucally the requriment is to switch dr cr in 1 button!!
    but u have added two different button
     


  17. Himanshu-2002

    Himanshu-2002 Active Member


    Then

    [Button: Example]
    Key:Alt +Z
    Title: If ##Var Then "First Value" else "second value"
    Action: Set : Var: Not ##Var

    And After this Define Variable
     


Share This Page