Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

OnRowDblclick won't add a record to another table

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    OnRowDblclick won't add a record to another table

    I am trying to add a new record to another table using the double click event in a browse and neither one of these scripts does anything - what am I missing?

    Code:
    if parent.mode_get()<> "VIEW" then
        parent.commit()
    end if
    ''select a client and doublclick to add a new Intake
    ''convert to XD Browse 
    dim global userid as c
    dim c as p
    dim t as p
    c = table.current()  'Client
    t = table.open_session("INT_HDR",FILE_RW_SHARED)
    t.enter_begin(.t.)  'honor field rules
    t.date_in = date()
    t.CLIENT_SSN = c.ssn
    t.CLIENT_ID = c.client_id
    t.MEMB_ID = c.memb_id
    t.CSWRKR = userid
    t.enter_end(.t.)
    t.close()
    Code:
    'Genie Generated: Open the table that you want to update...
    dim tbl as p 
    tbl = table.open("int_hdr",FILE_RW_SHARED)
    
    tbl.enter_begin()
    tbl.DATE_IN = a5_eval_expression("=date()",local_variables())
    tbl.CLIENT_SSN = a5_eval_expression("=Ssn",local_variables())
    tbl.CLIENT_ID = a5_eval_expression("=Client_Id",local_variables())
    tbl.MEMB_ID = a5_eval_expression("=Memb_id",local_variables())
    tbl.CSWRKR = convert_type(userid,"Character")
    tbl.enter_end(.t.)
    tbl.close()
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

    #2
    Re: OnRowDblclick won't add a record to another table

    Have you tried debugging to see which steps are actually being executed?
    There can be only one.

    Comment


      #3
      Re: OnRowDblclick won't add a record to another table

      I don't know how to use the debugger. I will try tracing and see if that reveals anything. If all that fails, I suppose I could add a browse button...
      Robin

      Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

      Comment


        #4
        Re: OnRowDblclick won't add a record to another table

        Set code as below. Debug window will/should open when onrowdblclick envent fires. Use F12 to step through each line of code.
        Code:
        Debug(1)
        if parent.mode_get()<> "VIEW" then
            parent.commit()
        end if
        ''select a client and doublclick to add a new Intake
        ''convert to XD Browse 
        dim global userid as c
        dim c as p
        dim t as p
        c = table.current()  'Client
        t = table.open_session("INT_HDR",FILE_RW_SHARED)
        t.enter_begin(.t.)  'honor field rules
        t.date_in = date()
        t.CLIENT_SSN = c.ssn
        t.CLIENT_ID = c.client_id
        t.MEMB_ID = c.memb_id
        t.CSWRKR = userid
        t.enter_end(.t.)
        t.close()
        There can be only one.

        Comment


          #5
          Re: OnRowDblclick won't add a record to another table

          Not even the debugger opens... I'm going to try a msg box - nope, the event just will not fire in a stand alone browse. This is pre v5 behavior! I will restart Alpha and see if that helps.
          It didn't. Bug report next
          Robin

          Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

          Comment


            #6
            Re: OnRowDblclick won't add a record to another table

            Robin

            Errr... you need the debugger... ;) all this time I thought you were using it....

            Please post an example of what you are doing. If we can prove it's an bug, then you can submit it.

            Something fishy...
            Al Buchholz
            Bookwood Systems, LTD
            Weekly QReportBuilder Webinars Thursday 1 pm CST

            Occam's Razor - KISS
            Normalize till it hurts - De-normalize till it works.
            Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
            When we triage a problem it is much easier to read sample systems than to read a mind.
            "Make it as simple as possible, but not simpler."
            Albert Einstein

            http://www.iadn.com/images/media/iadn_member.png

            Comment


              #7
              Re: OnRowDblclick won't add a record to another table

              Al,

              I gave a shot at trying to duplicate something similar to what was described and received very inconsistent results from the onrowdblclick in a standalone browse. Most times clicking into a cell from another row and then double clicking did not fire the onrowdblclick. Then clicking into another cell in the same row and double clicking did. Usually clicking into the leftmost cell in a row and double clicking did fire the onrowdblclick but some times it only deselected the cell contents and placed the cursor at the end of the cell contents (text).

              I wonder if it has something to do with the Windows mouse click speed settings?

              Attachment is a Windows 10 Steps Recorder session illustrating the occasional onrowdblclick event firing, .mht format viewable in Internet Explorer.

              onrowdblclick.zip
              Last edited by Stan Mathews; 01-17-2017, 03:54 PM.
              There can be only one.

              Comment


                #8
                Re: OnRowDblclick won't add a record to another table

                In settings I have the debugger set to no for launching with every script error - but this should not effect the Debug(1) command used in a script should it?

                Also, when attempting the bug report on build 4811 I was prompted to update to 4815 - so I did, but neither will run this browse event.

                Stan somewhere in the help I read that if the browse is read only then double clicking on any field in the row should run the event. I don't think I tried that...nope no difference.

                @ Al - I posted the script above - including the AS genie code. But my code doesn't matter it won't even fire just the msgbox()
                Robin

                Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                Comment


                  #9
                  Re: OnRowDblclick won't add a record to another table

                  Stan

                  I think I have relied on double-clicking on the row selector on the left of the row for a consistent result.

                  I've also used a right click menu with a UDF called from it rather than the double click.
                  Al Buchholz
                  Bookwood Systems, LTD
                  Weekly QReportBuilder Webinars Thursday 1 pm CST

                  Occam's Razor - KISS
                  Normalize till it hurts - De-normalize till it works.
                  Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                  When we triage a problem it is much easier to read sample systems than to read a mind.
                  "Make it as simple as possible, but not simpler."
                  Albert Einstein

                  http://www.iadn.com/images/media/iadn_member.png

                  Comment


                    #10
                    Re: OnRowDblclick won't add a record to another table

                    Originally posted by MoGrace View Post

                    @ Al - I posted the script above - including the AS genie code. But my code doesn't matter it won't even fire just the msgbox()
                    I'm looking for an example of your table and browse, so we can do the same steps you are.

                    Think of submitting the bug report to the messageboard before sending it to Alpha.
                    Al Buchholz
                    Bookwood Systems, LTD
                    Weekly QReportBuilder Webinars Thursday 1 pm CST

                    Occam's Razor - KISS
                    Normalize till it hurts - De-normalize till it works.
                    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                    When we triage a problem it is much easier to read sample systems than to read a mind.
                    "Make it as simple as possible, but not simpler."
                    Albert Einstein

                    http://www.iadn.com/images/media/iadn_member.png

                    Comment


                      #11
                      Re: OnRowDblclick won't add a record to another table

                      Al,

                      I've never used the functionality in my efforts so I had to look it up. I have to agree that the documentation does specify that it fires when the row selector is double clicked. That said, it does sometimes fire when individual cells are double clicked.

                      Learned a bit, still confused.

                      Thanks
                      There can be only one.

                      Comment


                        #12
                        Re: OnRowDblclick won't add a record to another table

                        Originally posted by Stan Mathews View Post
                        Al,

                        I've never used the functionality in my efforts so I had to look it up. I have to agree that the documentation does specify that it fires when the row selector is double clicked. That said, it does sometimes fire when individual cells are double clicked.

                        Learned a bit, still confused.

                        Thanks
                        If I have real estate (ie room), I'll build a button on the row for the user to click. Says like - Details

                        Though usually real estate is at a premium.
                        Al Buchholz
                        Bookwood Systems, LTD
                        Weekly QReportBuilder Webinars Thursday 1 pm CST

                        Occam's Razor - KISS
                        Normalize till it hurts - De-normalize till it works.
                        Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                        When we triage a problem it is much easier to read sample systems than to read a mind.
                        "Make it as simple as possible, but not simpler."
                        Albert Einstein

                        http://www.iadn.com/images/media/iadn_member.png

                        Comment


                          #13
                          Re: OnRowDblclick won't add a record to another table

                          It's probably some system issue I am having. Every time Win 10 updates, something gets messed up, which is why I didn't try a reboot yet. Selwyn and Jerry both of couse have 'no problems'. So I guess it's me.
                          Robin

                          Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                          Comment


                            #14
                            Re: Updating table takes 5 sec in a local PC setup.

                            here is an experiment and see if you can improve upon to suit your needs:
                            https://www.screencast.com/t/8ldWKVRvA
                            Code:
                            dim brws as P
                            dim record as n
                            
                            brws = topparent:Control_browse1.this
                            record = brws.current_record()
                            ui_msg_box("","Record is "+record)
                            
                            dim tbl as p
                            'debug(1)
                            tbl=table.current()
                            dim name as c
                            dim address as c
                            dim city as c
                            dim state as c
                            dim zipcode as c
                            name = tbl.NAME
                            address = tbl.ADDRESS
                            city = tbl.CITY
                            state = tbl.STATE
                            zipcode = tbl.ZIPCODE
                            
                            dim cs2 as c = ""
                            cs2 = cs2 + "id=" + crlf()
                            cs2 = cs2 + "name="+name+ crlf()
                            cs2 = cs2 + "address="+address+ crlf()
                            cs2 = cs2 + "city="+city+ crlf()
                            cs2 = cs2 + "state="+state+ crlf()
                            cs2 = cs2 + "zipcode="+zipcode+ crlf()
                            
                            
                            record_add("t2", cs2)
                            while the code that is seen in the video was experimental, here is the code, all that is necessary, to do what i did.
                            thanks for reading

                            gandhi

                            version 11 3381 - 4096
                            mysql backend
                            http://www.alphawebprogramming.blogspot.com
                            [email protected]
                            Skype:[email protected]
                            1 914 924 5171

                            Comment


                              #15
                              Re: OnRowDblclick won't add a record to another table

                              Hi Gandhi,
                              Well except for not having to open and close the target table, I am not sure getting the string created is really worth it.

                              In regard to the OP, I did make a new browse with a simple msgbox and the double click event does seem to be working correctly with no other frills added. So now I'll try my script on it and see if that works. It could be that in preparing the browse for an XD conversion, I messed up the XML - or something.
                              Robin

                              Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                              Comment

                              Working...
                              X