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

Pointer to form's query

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

    Pointer to form's query

    Hi all,

    I am going round in circles on something that should be easy.

    I have a button on a form which calls a second form based on the same table (set)in dialog mode. I am using the dialog form as a record picker. It has an embedded browse and users double click on a row to return to the calling form with the selected record showing.

    This works fine.

    The problem is that the calling form's filter includes a variable and I re run the query on the dialog form which is slow on a network.

    Can I,
    get a pointer to the calling form's query and simply apply it to the dialog form thus obviating the need to run the same query a second time.

    Bill
    Bill Hanigsberg

    #2
    RE: Pointer to form's query

    Bill,

    Can you leave the called (dialog) form open, but hidden? If so, I should think you would not need to re-run the query when you 'show' it again. Is this what you have in mind?

    -- tom

    Comment


      #3
      RE: Pointer to form's query

      Bill, on re-reading your post I see that I missed the point. (Was looking in the wrong end of the telescope!)

      I don't think you can see the calling form's query list from the called (dialog) form. Will be very interested if others can suggest a solution.

      First thought that comes to mind here would be to investigate the use of a conditional object on your calling form. Something that could hold the browse object you need, but remain hidden, only to popup when it's time to select a record. Would something like that work?

      -- tom

      Comment


        #4
        RE: Pointer to form's query

        Bill,

        You know of course that you could populate a ui_get_ list_array and let the user select the desired entry from there, without opening another form or re-running the query...

        I'm thinking the array could be populated earlier in the sequence, and the list box remain hidden until needed...

        -- tom

        Comment


          #5
          RE: Pointer to form's query

          Hi Tom,

          I managed to do it and it is not difficult. I attach the script with the old lines which recreate the query commented out and the new lines indicated. The script runs from a toolbar button.

          It works instantly which is my goal. The previous version really couldn't be optimized so on the network with a cartload of records in the application you could see the progress bar moving.

          Since I have my users jumping among forms but always seeing a particular selection of records (their department's) I think this technique will be of use to me.

          All the best,
          Bill
          Bill Hanigsberg

          Comment


            #6
            RE: Pointer to form's query

            and I don't even need
            q = t.index_primary_get()
            because

            t = table.current(1)
            vTag = t.index_name_get(1)

            gets the tag which is all I need.

            It seems I can't apply the index to the dialog form using a pointer but I can tell it to use an existing query on the table so long as I have its name.

            I am presuming that in the expression "index_name_get(1)" number 1 will always give you the index active index in the current session.

            Time will tell.

            Bill
            Bill Hanigsberg

            Comment


              #7
              RE: Pointer to form's query

              Bill, how did you intuit the use of the 'tag' property for the called table? I'm certain I would never have thought to use it...

              -- tom

              Comment


                #8
                RE: Pointer to form's query

                Well Tom, I figured that tag meant name and tag does get you the name of a named index so I assumed that all those files with filenames begining with $$ that we try so hard to delete had names too, even if they began with dollar signs.

                I will concede that I wondered whether it would work but it did. As Aristotle said, "Actuality implies possibility". As my mother said, "go figure?"

                Best,
                Bill
                Bill Hanigsberg

                Comment


                  #9
                  RE: Pointer to form's query

                  Caveat:

                  Further testing required. I'll report back tomorrow.

                  Bill
                  Bill Hanigsberg

                  Comment


                    #10
                    RE: Pointer to form's query

                    It doesn't work.

                    That is, I have not found a way to obtain a pointer to the query controlling the current form. Tag works ok but refers to the index controlling the table. One might think that this is the query imposed by the current form but it seems not to be true.

                    So I am left with the original problem. The reason I posted was that I have some recollection of a newish method to grab this property but I can't remember where it is.

                    To make things even worse, I impose the filters on the forms using xbasic so when I try to get at them using form based methods I get an empty string.

                    Bill
                    Bill Hanigsberg

                    Comment


                      #11
                      RE: Pointer to form's query

                      Bill, maybe it's time to investigate ui_get_list_array() to avoid burdening the system with the load of opening a new form and re-running the query. If the sole purpose of the called form is to present a list for the user to select from, maybe ui_get_list_array() will suffice. It's bound to be faster, though the display options are more limited.

                      -- tom

                      Comment


                        #12
                        RE: Pointer to form's query

                        Bill

                        Been following your post and I think I understand what you want. I had a similar need and found that running a query before opening the dialog was just too slow. Instead, I tried a filter on the form which was set to filter using a global variable. An index existed on the field to use in the filter. Example - grp_no is a field for a list of inventory groups. I set a global variable , "grp_no", to the group I want to see. The global is initially defined in an autoexec script (could be defined in the table properties too) Then in the form filter I put

                        Grp_No=var->grp_no

                        This works many times faster than running a query, since an index already exists for the grp_no field. I normally also include an order expression too.

                        Jerry

                        Comment


                          #13
                          RE: Pointer to form's query

                          Thanks to you both.

                          This morning I experimented with another way which works but is a bit of trouble to retrofit.

                          I covered my entire calling form with a conditional object and put everything from the original on the default layer. On a second layer I put everything I had on the called (dialog) form.

                          Since the two "forms" are actually the same form they have the same record pointer, filter, and order so choosing a field on the one instantly synchs to the other.

                          So this does work. The same button that called up the dialog now just changes a variable and refreshes the conditional object. Double click on a row in the embedded browse on the second layer of the cond obj toggles you back by pressing the same button (the same code won't work directly on the double click event).

                          My problem is I have so much event based code on the original form that I hesitate to mess with it. Perhaps I'll experiment with both of your approaches first.

                          I concur with Jerry's observation about the speed of the query process. That's why I'm seeking an alternative.

                          Best to you both,
                          Bill
                          Bill Hanigsberg

                          Comment


                            #14
                            RE: Pointer to form's query

                            I have a solution of sorts. It involves moving the deck chairs around in order to create a query which will optimize. Since this is really a different topic I am starting a new thread.

                            There is a demo.

                            Bill
                            Bill Hanigsberg

                            Comment

                            Working...
                            X