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

How To Implement "Find Record" Feature Based on Pre Determined Column and Value?

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

  • How To Implement "Find Record" Feature Based on Pre Determined Column and Value?

    From a form, I know how to implement this on the parent table, that works well, it shows a dialog and the user enters their desired info to search for. The embedded browse is not queried, instead, the focus is given to the matching record in the browse. That's perfect!

    However, if I have an embedded browse based on a one to many child table, how can I code this same feature without the popup dialog? I do not want the dialog to pop up, the value to search for would be stored in a variable, and I want to code in the column to search in.

  • #2
    Hi Nigel,
    I love you brother but it is not possible to follow what you have going on and want to happen based on what you posted with this thread. The structure of your situation is nebulous, too many undefined embedded browses and what "popup dialog" are you referring to?
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

    Comment


    • #3
      Scenario #1
      I have a form with an embedded browse, the browse is based on the parent table, there are 2,000 records being shown in the browse, I can successfully use the following function to jump to the record of choice.

      'Display custom Find_by_Key dialog in current form.
      topparent.FindBy_DefinedKey("Find Record","Search for:",1,"",.f.,"$a5_find_by_key")

      The above code is attached to the "On Push" event of a button, when I click this button, a little dialog pops up, it allows me to type what I'm searching for when I click the "OK" button on the dialog, the matching record gets highlighted/selected.
      this is perfect for what I use it for.

      Scenario #2
      I have another form with an embedded browse, this embedded browse is based on a one-to-many child table, I want the same result as in "Scenario #1", I want to jump to the matching record in the browse, I do not want to query the browse, I only want to highlight/select the matching record.
      Also, I do not want the user to manually enter the value to search for into a popup dialog, I do not want to use a pop dialog any at all, I want to fetch this value from a variable and have the matching record highlighted automatically.

      Use
      This is for my POS software, "Scenario #2" is my invoice form, the embedded browse is based on the "invoice_items" table. Right now, when the cashier is scanning items at the checkout counter, each item they scan, adds a record to the table, however, if they scan an item that they already scanned previously, I do not add a duplicate record to the table, instead, I increment the "quantity" by 1. This is working just fine, however, the last item in the list stays highlighted, I would like whenever the cashier scans an item that already exists in the current invoice, not only does the "quantity" change, but the focus is moved from the last/bottom record to the record that just got changed.

      Comment


      • #4
        Nigel, that's a much better description. Shall we assume the form is based on a set and that the embedded browse displays linked one to many child table records? If so, I don't know of a way to accomplish your goal. Will be watching this thread to see if others can suggest something.

        EDIT: wondering if you could use the fetch_previous() method of the browse object to step through the list, stopping when you hit the desired item?
        Last edited by Tom Cone Jr; 11-08-2020, 08:07 AM.

        Comment


        • #5
          Thank you Tom.

          Your assumption is accurate.

          I will give your suggestion a shot.
          It is not a guarantee though, that the matching record will ALWAYS be found via fetch_previous() ,
          In most cases, if there's a match, it would be found by going backwards, but, there will be cases where a match is found by going forward.
          example, suppose the 10th, 11th and 12th items scanned are all duplicates, then, to highlight each record as they are scanned, you'd see the "focus" jumping forward and backward, because, the existing matches would most likely be scattered in the browse.
          But, I will see how far I can get with your suggestion.

          Much thanks!

          Comment


          • #6
            How about adding some code to the process that increases the item qty?
            Capture the variables as you scan and select the one you want to locate the browse
            You may have to put a hidden field on the form to synch the browse and record.
            Ted Giles
            Example Consulting - UK
            .

            sigpichttp://ec12.example-software.com//
            See our site for Alpha Support, Conversion and Upgrade.

            Comment


            • #7
              I already have the "quantity" working Ted.
              also, I already have the "Item #" stored in a variable.

              The issue on the table is:
              How to jump to the desired record in the browse, I don't know how to do it.

              Comment


              • #8
                Nigel, You mention duplicates. This puzzles me. I don't know why there would be duplicate records in the list of items in your browse. The whole point of incrementing the Qty is to avoid having to enter a duplicate item, right? I must be missing something here.

                Comment


                • #9
                  You are correct Tom.
                  However different POS softwares approach this topic differently, some stores near my home would list a particular item multiple times, while others would list it only once, and increment the quantity with each scan.

                  ​​​​​​ For my software, I choosed option "B". I do not have duplicates in my invoices, I add a unique product with an initial quantity of "1", then I increment the Quantity afterwards.

                  Now, I want to automatically give focus to the item in the browse.
                  Imagine an invoice with 20 unique items, including "Acme Toothpaste", which is the 5th item in the list. All these 20 items have a quantity of "1".
                  The 21st scan is another "Acme Toothpaste", my software will not add a new record, it will remain at 20 records, but, the quantity for "Acme Toothpaste" will now become "2".
                  The problem is, with the cashier rushing to complete this transaction and move on to the next customer in the line, she has no time to check why Acme Toothpaste wasn't added, and why it is not the last item in the list at the bottom.
                  I could beautifully allow her to verify that the product is accounted for, if I could just move the highlight of the browse from record 20 to record 5.
                  It was originally at record 20 because that was the last item added, but now, I want to highlight record 5 because this is the record that just got incremented after the cashier scanned the 2nd Acme Toothpaste.

                  So, my goal now is to figure out:
                  How do I jump to record 5 in the list to visually inform the cashier that this product wasn't added as a new record, instead, its quantity was incremented?
                  All I need is, how do I jump to the matching record?

                  Comment


                  • #10
                    Nigel, when it is necessary to fire the quantity change/update, because you recognise a duplicate, can you add code to that process so you refresh with a new search?

                    Without it in front of me, I can only conjecture, but I will try and put an example together a bit later.

                    Aaaah! Crossed posts. Understand now.
                    Ted Giles
                    Example Consulting - UK
                    .

                    sigpichttp://ec12.example-software.com//
                    See our site for Alpha Support, Conversion and Upgrade.

                    Comment


                    • #11
                      Nigel, see if this helps. You should be able to use your variable to find the correct record.
                      If you update the quantity, then it should be possible to add the folowing after the qty addition

                      topparent.find(var_key_target)

                      Nigel 01.zip
                      Ted Giles
                      Example Consulting - UK
                      .

                      sigpichttp://ec12.example-software.com//
                      See our site for Alpha Support, Conversion and Upgrade.

                      Comment


                      • #12
                        Nigel, I'd find jumping back and forth confusing. And, when you jump back how will user know the Qty has been increased unless they can see the previous value? Would not approach it like that. Instead, when a scanned item is already in the list I'd pop up a simple dialog to inform the user, displaying the item name, previous qty and new qty. Then I'd increment the qty count in the previously entered item record.

                        Comment

                        Working...
                        X