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

Problem: sorting an embedded browse, by clicking the column heading, disables my quer

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

    Problem: sorting an embedded browse, by clicking the column heading, disables my quer

    Background:
    I have noticed that when I click on an embedded browse column heading it removes the �filter criteria� set by my query which is affective at that time. I do want the user to be able to select a different sorting order and sorting filed, so I do not want to disable this functionality.
    Question:
    1. Is this behaviour expected and correct?
    2. How can I keep my filter persistent even after the user clicks on the column heading?

    kind regards
    George

    #2
    Re: Problem: sorting an embedded browse, by clicking the column heading, disables my

    A working example of what you're talking about would help. I click the column headers in the embedded browse object in the Invoice form in AlphaSports and nothing changes (apart from the column being selected). You're doing something differently but haven't described it yet. A working example with instructions telling us how to find the specific issue would be a big help, we need to see the way you've implemented the column sort.
    Last edited by Tom Cone Jr; 04-06-2008, 07:14 AM.

    Comment


      #3
      Re: Problem: sorting an embedded browse, by clicking the column heading, disables my

      Look at this post - it offers some insight


      http://msgboard.alphasoftware.com/al...ad.php?t=72515

      Tom Baker

      Comment


        #4
        Re: Problem: sorting an embedded browse, by clicking the column heading, disables my

        George,

        I have the problem in v7. Have not tried it in v8 or 9. What I did to overcome this was to build another query ofr each of the needed sorts and filters and put them on a dropdown. The embedded browse was set to not let them query the columns directly. This just resets the query for the form and browse.

        I had/have a problem with a salesman seeing other salesmen's records. That was my reason for having a filter query to begin with for the form.

        If there is a better way, I'm in. See two of the choices below:


        Code:
        a_command = ui_popup_menu(vmenuitems)
        select case
        '=====================================================================================================
        case a_command = "Active Customers"
         'dim tbl as P
         'tbl = table.current()
         'indx = tbl.index_tag_add("xx", "date", "scode=var->scode.and.status='D'", "A")
         dim shared numbs as n
         numbs = A5_get_records_in_query("names","scode=var->scode.and.status='A'")
         if numbs <= 0 then
          ui_msg_box("None Found","There are no Order Units Found")
          goto end
         end if 
         tbl=table.current()
         query.description = "Active"
         query.order = "date"
         query.filter = "scode=var->scode.and.status='A'"
         query.options = "N"
         tbl.query_create()
         parent.fetch_last()
         topparent.Resynch()
         topparent.Refresh_Layout()
        '=====================================================================================================
        case a_command = "Sold Customers"
         dim shared numbs as n
         numbs = A5_get_records_in_query("names","scode=var->scode.and.status='S'")
         if numbs <= 0 then
          ui_msg_box("None Found","There are no Sold Units Found")
          goto end
         end if 
         tbl=table.current()
         query.description = "Sold"
         query.order = "date"
         query.filter = "scode=var->scode.and.status='S'"
         query.options = "N"
         tbl.query_create()
         parent.fetch_last()
         topparent.Resynch()
         topparent.Refresh_Layout()
        '=====================================================================================================
        Hope this helps.
        Dave Mason
        [email protected]
        Skype is dave.mason46

        Comment


          #5
          Re: Problem: sorting an embedded browse, by clicking the column heading, disables my

          I have attached the app, single form based on a single table. User & password = George.

          Background:
          The form opens and filters the embedded browse on the field "status" and value "imported". This can also be achived by pressing the "view imported" button. One can also change the filter by pressing the other "view committed".

          Problem:
          Clicking on the browse column heading removes the filters. I expect it to only sort.

          Question:
          1. Should this not be classified as a bug?
          2. How can I overcome this problem? Offcourse I want the user to be able to sort by pressing the column heading.


          Regards
          George

          Comment


            #6
            Re: Problem: sorting an embedded browse, by clicking the column heading, disables my

            George, your form is based on single table.

            The embedded browse object is displaying records from that table. When you sort a column in the browse Alpha is sorting all the records permitted by the base query applicable to the form. Since none of your queries affect the base query for the form the effect of sorting a column is to show all the records.

            I know this is not clear. It's hard to explain, at least for me. Here's how I understand things and what I say should be taken with a grain of salt and is subject to correction by those with more experience.

            If you embed (hard code) a specific filter in the properties of your form layout a "base query" is run by Alpha when the form opens. This query determines the range of records the form is permitted to display. The show_all button on the toolbar cannot expand this range. It's not even enabled unless you further filter the records using a query. The form "Embedded_Filter_Example" in the attached database illustrates this. When you sort a column in the browse on that form it sorts all the records in the permitted range but does not extend the range either. The result is what you seek. A column sort does not release the base query for the form, established by the embedded filter. Try it you'll see what I mean. You'll find the base query defined in the filter expression embedded in the form layout.

            But, embedding a single filter expression in the filter properties of the layout is not flexible. What if you want to use the same form but display a different range of records? You can't, without redefining the base query for the form. The Query Imported and Query Committed buttons in your example do NOT redefine the base query for the form. They simply filter the records in the permitted range, which in your case is all the records. You think you've narrowed the permitted range of records, but really all you've done is further filter (narrow) the range a bit. The original permitted range (defined in the form's filter properties) remains intact. And, in your case, it's undefined [i.e. your form does not contain a filter expression that's been hard coded into the layout], so all records are included in the permitted range for the form. Well, guess what, since all records are available to the form, the column sort runs agains all the records and you get the effect you find objectionable. Records previously excluded by your button's query are now visible again. This is because your button does not redefine the base query for the form.

            Another way to see the same thing is to open your form without an embedded filter expression. Then use the quick filter tool on the tool bar to filter the records displayed in the browse. Now use the column sort to try to change the display sequence of your filtered records. Oops. All the records are now visible again. This is happening because the quick filter tool does not redefine the base query applicable to the form.

            Take a look at your form in my attached example database. I've changed some things to make it work the way you want.

            - OnActivate event for the form sets the base query for the form to all records, and defines a specific default sort sequence.

            - Your buttons now redefine the base query for the form. Notice that this is different from running a query against the records in the form's permitted range.

            In this modified form the column sort does not "misbehave" because the permitted range of records for the form is being redefined by the buttons I've modified. Note: "permitted range of records" is my terminology. You won't find it in the help file. Alpha calls it the "base query for the form".

            Every form has a base query even if that query shows all records. When your form is based on a single table and you want to use the column sort feature of the embedded browse you must re-set (redefine) the base query for your form when you query the records. This is NOT required when your form is based on a set of tables and the embedded browse object displays records from the linked child table. There, the browse object is displaying a filtered subset of child table records. Only those that are linked to the current parent table record are displayed. The column sort functionality does not cause unlinked records to appear in the browse.

            My guess here is that most of us use embedded browses for our linked child tables and rarely encounter the problem you have hit. However, the solution is easy. For forms based on a single table change the way you run your queries so that the base query in effect for the form is redefined by your query instructions.

            I hope this is clear and that the attached example proves useful.

            -- tom
            Last edited by Tom Cone Jr; 04-06-2008, 05:30 PM.

            Comment


              #7
              Re: Problem: sorting an embedded browse, by clicking the column heading, disables my

              Hey tom,

              Is there a password?
              Dave Mason
              [email protected]
              Skype is dave.mason46

              Comment


                #8
                Re: Problem: sorting an embedded browse, by clicking the column heading, disables my

                Yeah, mentioned earlier in the thread. Try "George".

                Comment


                  #9
                  Re: Problem: sorting an embedded browse, by clicking the column heading, disables my

                  Nice Tom,

                  May I use the idea?
                  Dave Mason
                  [email protected]
                  Skype is dave.mason46

                  Comment


                    #10
                    Re: Problem: sorting an embedded browse, by clicking the column heading, disables my

                    Dave, sure. The technique for dynamically modifying the base query for a form can be a great way to assure that certain users can't see records that belong to other users. I'm glad you think it might be useful. -- tom

                    Comment


                      #11
                      Re: Problem: sorting an embedded browse, by clicking the column heading, disables my

                      I believe this is a BUG and should be reported.

                      In an embedded browse based on the parent, the sort does not work, period.
                      That shouldn't happen.

                      In an embedded one based on a set, clicking a column to sort, releases the filter.
                      That should not happen either.

                      I reported as a bug.

                      Comment


                        #12
                        Re: Problem: sorting an embedded browse, by clicking the column heading, disables my

                        Originally posted by georgefurnel View Post
                        I have attached the app, single form based on a single table. User & password = George.

                        Background:
                        The form opens and filters the embedded browse on the field "status" and value "imported". This can also be achived by pressing the "view imported" button. One can also change the filter by pressing the other "view committed".

                        Problem:
                        Clicking on the browse column heading removes the filters. I expect it to only sort.

                        Question:
                        1. Should this not be classified as a bug?
                        2. How can I overcome this problem? Offcourse I want the user to be able to sort by pressing the column heading.


                        Regards
                        George


                        thanks

                        it is a bug.

                        the work around would be to change the behavior of the browse column onclick so that it does not do a sort, but instead calls an xbasic event.
                        then, in your event handler apply the sort.
                        you will notice that if you sort on the field 'F2' by giving focus to the field on the Form (not the browse column), then clicking the sort icon on the toolbar, it works as expected

                        Comment


                          #13
                          Re: Problem: sorting an embedded browse, by clicking the column heading, disables my

                          Thanks Selwyn.
                          In his response, Selwyn refers to 'F2'.
                          I am attaching the same zip file I sent to Selwyn so everyone knows what he is talking about.

                          There were few threads recently regarding this same issue, one that comes to mind by Ken Nordin. So, I suppose, the same answer applies.
                          Last edited by G Gabriel; 04-07-2008, 02:55 PM.

                          Comment


                            #14
                            Re: Problem: sorting an embedded browse, by clicking the column heading, disables my

                            Originally posted by G Gabriel View Post
                            Thanks Selwyn.
                            In his response, Selwyn refers to 'F2'.
                            I am attaching the same zip file I sent to Selwyn so everyone knows what he is talking about.

                            There were few threads recently regarding this same issue, one that comes to mind by Ken Nordin. So, I suppose, the same answer applies.
                            Hi Gabe,

                            Thanks for the heads up. I'm looking forward to the bug fix and will try the work around.

                            kenn
                            TYVM :) kenn

                            Knowing what you can achieve will not become reality until you imagine and explore.

                            Comment


                              #15
                              Re: Problem: sorting an embedded browse, by clicking the column heading, disables my

                              Originally posted by Selwyn Rabins View Post
                              thanks

                              you will notice that if you sort on the field 'F2' by giving focus to the field on the Form (not the browse column), then clicking the sort icon on the toolbar, it works as expected
                              I appreciate the fact that the bug is acknowledged and the workaround mentioned by Selwyn and Gabe.
                              Tom I learned a lot from your commentary.
                              Unfortunately the work around does not seem to word for me, I am using the example app I attached to this thread.

                              Could you may be shed some light on it?

                              Kind regards
                              George

                              Comment

                              Working...
                              X