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 Question

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

  • OnRowDblClick Question

    I've been a long time user of Alpha products but have not done much in recent years for a variety of reasons. So, much of what I knew has evaporated from my porous brain. If anyone can offer some help, it would be much appreciated.

    I'm using A5 v12 to run a desktop app on Windows 7 and an older XP PC.

    In my order processing application I wanted to be able to double-click on a row in a browse that displays the items on an order, and move an item quantity from "Hold" to "Shipped." That's simple enough; I created an operation that does that nicely. Now by double-clicking on a specified browse row, I'd hoped it would run the operation and update just that row, but instead, wants to update all the rows in the record, which is not wanted. I expect there will be some Xbasic needed here, but how I get the op to work on just one row eludes me. Is there anyone that can offer some tips for an old time Alpha user?

    Many thanks if you can.
    Ed Merritt
    UniversalWorkshop.com

    Listen; there's a hell of a good universe next door: let's go.
    e.e. cummings




  • #2
    Re: OnRowDblClick Question

    What follows assumes your form is based on a two table set, with an order header as primary and a one to many child for order items. You don't describe the context very well. If I'm guessing wrong, ignore all that follows:

    Sounds like your operation is using the order id to "find" the records to be changed in the items table.

    A few ideas come to mind: (1) change the op so it uses the record number of the current item record in its query; or

    (2) Add an autoinc field to your items table so that each item record has a unique identifier, then base the filter in your op on the current item's identifier. In database speak that's called creating a primary key in the item table, and using the primary key in your op.

    (3) Write a bit of xbasic to update the field value without running a saved operation.

    Comment


    • #3
      Re: OnRowDblClick Question

      Tom, thanks, and here's more detail. It's a classic order_header and order_detail parent/child set. The orderID is used to bring the order up on the form, and a script runs to place the orderID on the Windows clipboard. The Endicia shipping client then grabs the orderID, populates its orderID field, then pulls the shipping address from A5's order_header table.

      In the order_detail table, all item quantities are in the "hold" field, and during the shipment processing, the OnRowDblClick script needs to run on a chosen row in the child browse to update two fields - the hold goes to 0, the shipped updates to the quantity that was in the hold field.

      The order_detail table has a unique number, the "orderdetailID" which is a sequential number in each record that comes from the website ecommerce database. That should work for your suggestion in 2). Do you know of any code samples that would show me how to read that number?
      Ed Merritt
      UniversalWorkshop.com

      Listen; there's a hell of a good universe next door: let's go.
      e.e. cummings



      Comment


      • #4
        Re: OnRowDblClick Question

        You could also pull the detail id field from the browse onto the form and hide it. When you doubleclick on the browse read that field.
        Robin

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

        Comment


        • #5
          Re: OnRowDblClick Question

          Ed,

          I'm not familiar with the website ecommerce database you mention. If each detail row gets its unique number when it's first saved then you can read the value of that field with a pointer to the child table. If the unique number is assigned when the item is shipped, then its too late to be of use in your onrowdblclk event.

          I tend to use saved operations when a "range" or "batch" of records are to be updated. I rarely use them to update a single record. In your case there's no reason to load another instance of the child table, search for the desired record, change it, save it, and then close that instance of the table, and then refresh your form. That's the work your saved opn would have to perform. I think it's wasted energy and time since the desired record is already in focus and the detail table is already open.

          By the way, your post is in the wrong forum. A5v12 posts now belong in the "Windows Desktop Applications" forum. But I understand such a thing is not obvious.
          Last edited by Al Buchholz; 11-19-2015, 11:40 AM. Reason: thread moved per Mr Cone's suggestion.

          Comment


          • #6
            Re: OnRowDblClick Question

            Be somewhat careful of the naming of the fields
            A field named xyz on a browse can also have the same name elsewhere on the form
            To make it simpler, I have started renaming the fields with f or b in front. Sometimes you need to address a browse field instead of the other one.
            This issue seemed to raise itself with v12.
            Dave Mason
            dave@aldadesktop.com
            Skype is dave.mason46

            Comment


            • #7
              Re: OnRowDblClick Question

              Ed,

              I could supply an example of the 3rd approach if you will supply sample data and your form. the form is stored in the dictionaries supporting your set.

              Comment


              • #8
                Re: OnRowDblClick Question

                Thanks Dave, I wasn't aware of that. All of the tables in use were created around 2011-2012, probably under v9 or v10.
                Ed Merritt
                UniversalWorkshop.com

                Listen; there's a hell of a good universe next door: let's go.
                e.e. cummings



                Comment


                • #9
                  Re: OnRowDblClick Question

                  Originally posted by DaveM View Post
                  Be somewhat careful of the naming of the fields
                  A field named xyz on a browse can also have the same name elsewhere on the form
                  To make it simpler, I have started renaming the fields with f or b in front. Sometimes you need to address a browse field instead of the other one.
                  This issue seemed to raise itself with v12.
                  Are you talking about the field name or the object name of the form or browse that contains the field?
                  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

                  Comment


                  • #10
                    Re: OnRowDblClick Question

                    form can have a name(not field name) of abcd on a form - it may be the same on the browse. Alpha can(and has) gotten confused which one to use.

                    safest to rename one or both of them to maybe "fabcd" for the form and "Babcd" on the browse. That way when using the field named on the form or browse, there is no confusion.

                    Had the issue or I would not know and thus not say it.

                    clarify: The actual field name in the database may be the same and has nothing to do with it's form name.
                    Dave Mason
                    dave@aldadesktop.com
                    Skype is dave.mason46

                    Comment


                    • #11
                      Re: OnRowDblClick Question

                      Hi Ed,

                      I would suggest putting a button on the row. It makes it better for the user to be sure they are working on the right row. Double click without confirmation can lead to mistakes. Best practice is to open a dialog and ask user for confirmation. If 'Yes' or 'OK', what ever you choose, then proceed (run process code).
                      Regards
                      Keith Hubert
                      Alpha Guild Member
                      London.
                      KHDB Management Systems
                      Skype = keith.hubert


                      For your day-to-day Needs, you Need an Alpha Database!

                      Comment


                      • #12
                        Re: OnRowDblClick Question

                        Keith, would each row need a button or would one button handle multiple rows? Sorry if my questions are so newbie level but my experience with A5 was good up to v5. I don't remember if the browse buttons were available at that time.
                        Ed Merritt
                        UniversalWorkshop.com

                        Listen; there's a hell of a good universe next door: let's go.
                        e.e. cummings



                        Comment


                        • #13
                          Re: OnRowDblClick Question

                          You could also add a logical field to the table and display it in the browse as a checkbox. If the user checks the box, your field rule can "post" the HOLD to SHIPPED when true and reverse it when false. Which might be more intuitive for the user.
                          Robin

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

                          Comment


                          • #14
                            Re: OnRowDblClick Question

                            Hi Ed,

                            Sorry for the delay in getting back to you.

                            would each row need a button or would one button handle multiple rows? The answer is Yes. But this is only programmed the once. Logically there would not be a button if the row did not exist.

                            I don't remember if the browse buttons were available at that time. You are correct, I believe this was a new feature in V9.

                            Having given my answer to your original question, I do like Robins suggestion.

                            Once you get into developing an element in a browse you will be amazed at what you can make it do. eg conditionally change an image, stock low show Red ball, or Green if stock level good. The possibilities are endless as to how you want the browse to display and behave.
                            Regards
                            Keith Hubert
                            Alpha Guild Member
                            London.
                            KHDB Management Systems
                            Skype = keith.hubert


                            For your day-to-day Needs, you Need an Alpha Database!

                            Comment


                            • #15
                              Re: OnRowDblClick Question

                              t=table.get("child_table_name")
                              t.change_begin()
                              t.fieldname="shipped" 'or whatever
                              t.change_end()
                              Cole Custom Programming - Terrell, Texas
                              972 524 8714
                              martin_w_cole@msn.com

                              ____________________
                              "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                              Comment

                              Working...
                              X