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

Querying a Set

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

  • Querying a Set

    Need help querying a table in a set. I have attached an example that includes (2) forms. The search query in the "Equipment" form works as expected, but when trying to use the search query in the "Customer.set" form, no results are found. Any and all help would be appreciated... JON
    Attached Files
    Last edited by jbk; 01-01-2013, 06:58 PM.

  • #2
    Re: Querying a Table in a Set

    Jon,

    Check this screencast.

    -- tom

    Comment


    • #3
      Re: Querying a Table in a Set

      Thanks Tom. Applying your advise makes the example work as expected. The example uses a 1:1 set but my program has a 1:Many set which I'm still having issues with. I tried the "Query Genie" and I can make the search work if I change the "Cross Level" setting to "Equipment". How and where would I apply the "Cross Level" function to my code.

      Thank you for the advise of adding "+\" to a long code line... JON

      Comment


      • #4
        Re: Querying a Table in a Set

        For a one-to-many set, where you're searching the linked child table you may have at least two different things in mind. Do you want to see all parent records, but only the children who match the search key? Or are you trying to display only parents that have one or more children who match the search key? These are two very different things. Which are you trying to do?

        Comment


        • #5
          Re: Querying a Table in a Set

          Tom, I would like to search a single parent record and look for a certain child within that record.

          Comment


          • #6
            Re: Querying a Table in a Set

            Sorry. I don't understand post #5.

            Maybe it would help if you explain the context of what you're attempting, and what a successful result would look like. Thanks.

            Comment


            • #7
              Re: Querying a Table in a Set

              Tom, I have attached an example. If you go to "Ace Heating" in the customer form, a using query genie and change the "query to records to which level" to "equipment" then choose: search by "model number", contains the characters "iphone", you'll see only the iphone listed now for "Ace Heating". But if I try to search for "model number" using the search button, no records are found.

              Thanks for all your help... JON
              Attached Files

              Comment


              • #8
                Re: Querying a Table in a Set

                Jon, I'm on deadline with a project here and won't be able to look at this until this evening. Maybe someone else will lend a hand in the meantime. -- tom

                Comment


                • #9
                  Re: Querying a Table in a Set

                  No problem Tom. I truly appreciate your help... JON

                  Comment


                  • #10
                    Re: Querying a Table in a Set

                    Jon,

                    Here's a different approach for you to consider. It works by setting a base filter for the child table in your form. I've added a second button to your form to release that filter. A base filter is equivalent to hard coding a filter for the child table into the properties of your form at design time. This may be close to what you want.

                    Regards,

                    -- tom

                    Comment


                    • #11
                      Re: Querying a Table in a Set

                      Implemented your suggestions into my "real live program" works as expected. Thank you.... I do have one question however, in the example, when the user presses "search equipment" they are given (3) options to search by: Manufacture, Model Number and Mobile Number. If the users chooses to search via Mobile Number and doesn't enter the mobile number with parenthesis it will return no results. What changes in the code would be needed so that the user could enter for example 818 (no parenthesis) and all records with this area code would be displayed? Any and all help would be appreciated.... JON

                      Comment


                      • #12
                        Re: Querying a Table in a Set

                        You're welcome. Hope the code was commented sufficiently.

                        Originally Posted by jbk
                        If the users chooses to search via Mobile Number and doesn't enter the mobile number with parenthesis it will return no results. What changes in the code would be needed so that the user could enter for example 818 (no parenthesis) and all records with this area code would be displayed? Any and all help would be appreciated.... JON
                        This happens because your data includes the leading (opening) parenthesis in each mobile number field. Your filter tells Alpha to search from left to right from the beginning of the field. The beginning value in the field is the parenthesis. So when the search string is entered without the parentheses it will never match any existing records. Is this understood?

                        There are several options:

                        a) change all the field values in your table to drop the parentheses;
                        b) change the filter so that it looks for the entered string of numbers wherever they might appear in the mobile_number field;
                        c) change the filter so that the search begins with character position 2 and then goes left to right from there;
                        d) change the filter to require the area code to be entered every time, but strip the opening and closing parentheses;
                        e) train your users to use parentheses... after all they entered them in the first place!

                        I think option (b) is the most flexible. Would not have to enter the area code, for example.

                        Option (c) is the one you asked for, but it would require the user to enter the closing parenthesis if they wanted to search for more than 3 characters i.e. 818)-505-1212

                        Most would opt for (a), and not waste space in the table by storing opening and closing parentheses that aren't necessary. They can be easily supplied when needed for reports.

                        What's your pleasure?

                        -- tom

                        Comment


                        • #13
                          Re: Querying a Table in a Set

                          I agree with you on option (b). I like having the opening and closing parentheses. More of a cosmetic thing with me. Thus the change in the field settings of mobile number.

                          What changes would I need to do in the example for option (b).

                          Thank again... JON

                          Comment


                          • #14
                            Re: Querying a Table in a Set

                            Change the filter expression to this:

                            filter = "(left(MFG,len([varC->prms.Parameter1])) = [varC->prms.Parameter1] ) .AND. " +\
                            "(left(Model_Number,len([varC->prms.Parameter2])) = [varC->prms.Parameter2] ) .AND. " +\
                            "([varC->prms.Parameter3] $ Mobile_Number )) "


                            Then go to the help documentation and study the "substring inclusion operator". It comes in real handy.

                            -- tom

                            Comment


                            • #15
                              Re: Querying a Table in a Set

                              Above code works great. Thank you... I have attached an example which has another "search option" for the user. When the user presses "search equipment" and chooses search option "ESN Number" and enters "55" (as an example) the seach script filters and shows only the ESN numbers that start with "55" if the user goes thru Browse2 and finds the record containing ESN Number starting with "55". My question is, what code is needed to add so that if a user enters "50" in search option only the customers having an ESN number starting with "55" are shown in Browse2. In the attached example, when user wants to search by ESN Number "55", I would like it to show only the customer "Jack's Auto" in Browse2. Thank you...JON

                              Comment

                              Working...
                              X