New to Tally, Not able to create action in this table.

Discussion in 'Free Source Codes' started by arinda, Dec 25, 2019.

    
  1. arinda

    arinda New Member


    I'm displaying a table of sorts in Rpt. It lists the entry from my url correctly but nothing happens on clicking the rows or pressing enter. I want the click to open Rpt_Ledger. Where am I going wrong?

    My code:

    [Report : Rpt]
    Title : $$LocaleString:"Details"
    Form : Frm
    Variable : UserID: String

    [Form : Frm]
    Part : Form SubTitle , Prt
    Local : Field : Form SubTitle : Info : $$LocaleString:"Search Results"
    On : Form Accept : Yes : Call : onClick_User : UserID

    [Part : Prt]
    Line : Prt_Title
    Line : UserRow
    Repeat : UserRow: Request _Collection

    [Line : Prt_Title]
    Use : Prt
    Local : Field : Name : Info : $$LocaleString:"Name"
    Local : Field : UserID : Info : $$LocaleString:"RegisteredID"
    [Line : UserRow]
    Field : Name
    Right Fields : UserID

    [Field : Name]
    Use : Name Field
    Set as : $Name
    Key : MouseClick, KeyEnter
    [Field :UserID]
    Use : Name Field
    Modifies : UserID: Yes
    Variable : UserID
    Set as : $UserID
    Key : MouseClick, KeyEnter

    [Key: MouseClick]
    Key : Left Click
    Action : CALL : onClick_User :$$Value
    [Key: KeyEnter]
    Key : Enter
    Action : CALL : onClick_User :$$Value

    [Function: onClick_User ]
    Parameter : paramnum : Number
    1 : Display : Rpt_Ledger

    [Rpt_Ledger]...
     


  2. teja varma

    teja varma Active Member


    what is Rpt_Ledger ?
    is it a customised report
     


  3. Ria

    Ria Member


    Since you are calling the function on form accept, it will be executed once you accept the form.

    This report is not creating any object, which means it is in display mode, so there is no form accept, hence there is actually no event when the function (onClick_User) will be called.

    To display line object , modify the definition as follows :

    Code:
    [#Line : User Row]
    
        Key : Display User On Enter
    
    [Key : Display User On Enter]
    
        Key        : Enter
        Action   : Display : Rpt_Ledger
        Mode    : Display


    you'll also have to associate the line object with the report, this is not the complete code.
     


  4. arinda

    arinda New Member


    Hi,
    Thanks for your help. I was looking for a similar event like form accept but for rows(lines). I followed your advice and its working. I was more concerned about the table not opening the Report Rpt_Ledger in the first place. I think I will be able to do the line object association which is why I did not provide complete code. Thank you again
     


  5. Ria

    Ria Member


    I meant that the code that I have written is not complete, if you want to associate the line object with the report.

    And, I don't think user is an object in Tally, so I think you cannot associate it just like you would associate an object.

    But that's not even your requirement I suppose.

    Happy to help
     


  6. arinda

    arinda New Member


    Hello,
    Is it possible to display Tally's own [Report] pages? Currently I am displaying my fields (from response) on a Report page I created. It would save time if after user choices, request is made and it redirects to the Create Ledger Page and pre-fills the data from my webresponse.
     


  7. Ria

    Ria Member


    Can you be more specific? Explain with the code or screenshots, maybe?
     


  8. arinda

    arinda New Member


    I want to open [​IMG] this page instead of my own Rpt_Ledger.
    When I go to menu definition in Tally developer I see the Ledgers menu items like create,display, alter open AccountsMaster which I can not find in the definition
     


  9. Ria

    Ria Member


    So, you want to open the Ledger report in create mode from your user report on pressing enter on a line?

    [Key : Display User On Enter]

    Key : Enter
    Action : Create : Ledger
     


  10. arinda

    arinda New Member


    Yes it worked. But I have to set the fields with my collection values(prefilling). I was looking for the Ledger Display Report definition to do it manually. Would it be possible to do in your way?
     


  11. Ria

    Ria Member


    You can try it in this way :

    1. In the key, change

    Action : Create : Ledger

    to

    Action : Create : Ledger2

    2. Create another report,

    [Report : Ledger2]
    Use : Ledger
    On : Load : Yes : Call : TestFunction

    3. Create the function to set the field values for the report
     


  12. arinda

    arinda New Member


    Thank you it worked!
     


Share This Page