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

Global updates and queries

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

    Global updates and queries


    I�m making a change to logical fields to allow me to print specific labels. This logical field is also used to tell me which records already have folder labels.

    How do you limit update to those records contained in specified records (query)? I�m in process of changing from version 3 to 4.5. When I run the update it updates all 8,000 plus records. I've recreated the update -- but it didn't help.

    My terminology �global update� may be incorrect since I can�t find it in the user manual.

    Thanks

    #2
    RE: Global updates and queries

    Robert,

    When you run a saved update operation Alpha Five uses a new instance of the table. It does no good to open a file, run a query, and then run the saved operation, because the saved operation will include all the records in the table by default.

    There are at least two solutions:

    1) Include the appropriate filter expression in the definition of the saved update operation, itself; or

    2) Put a button on your form that runs the equivalent update operation, but uses the current range of records (visible through the form), instead of opening another instance of the table.

    Give us more details, and tell us which you prefer and maybe we can offer more specific help.

    -- tom

    Comment


      #3
      RE: Global updates and queries

      Thanks for fast response. I will give it a try.

      B

      Comment


        #4
        RE: Global updates and queries

        How do I do your option two.

        I think I misread what you said. I included a button on form to run a save query (I had a button already on form to run the update). I had form open -- ran the query from the form and then the update. It still include all records. This is on a set with the query and labels from the parent.

        Thanks

        B

        Comment


          #5
          RE: Global updates and queries


          Robert,

          This has been discussed a number of times in this forum. Look for threads involving modifying saved operations.

          In the meantime, turn on the script recorder, and set the recording level option to 'low level'. Open your form and push your button, then close the form.

          OPen the script recorder and copy the entire script you see there to the Windows clipboard. Then post it here, so we can see it. We should be able to suggest corrections to get the proper range of records 'in focus'.

          the big picture is this:

          A saved operation assumes the table is closed, and includes within it code which opens the table afresh. It then runs the update against the table, and then closes it again.

          In your case we will need to modify the script contained in the saved update operation so that a new instance of the table is NOT opened. Instead, the script should be modified to use the CURRENT instance of the table supporting your form.

          There are several basic concepts that are often not well understood about Alpha Five.

          1) Each time you open a form you also open the table or set upon which it's based. The form and the table are automatically synchronized for you. As you navigate through the table using the form the table remains in synch. If you run a query through the form, the subset of matching records that you can see through the from are all that are 'currently in view' in the table, too.

          2) Alpha Five permits you to open multiple instances of the same table. Each is independent of the others. So, if you set a query through your form, and then open a second instance of the same table through the saved operation, the operation does not 'know' that the form's view of the table has been restricted to records that match your query.

          Fortunately, modifying the script used by the saved update operation is usually very easy.

          let's take a crack at it together, shall we?

          -- tom

          Comment


            #6
            RE: Global updates and queries

            Tom

            Form.View("SubSet@d:\a5v4 requirements\subset_l.set")
            :SubSet.activate()
            :SubSet.close()


            Thanks

            B

            Comment


              #7
              RE: Global updates and queries

              Bob,

              the script fragment you copied simply opens and closes the form.

              how about trying to capture the script that runs when you run the saved update operation?

              -- tom

              Comment


                #8
                RE: Global updates and queries

                I thought that was to simple -- sorry.

                Form.View("SubSet@d:\a5v4 requirements\subset_l.set")
                :SubSet.activate()
                :SubSet:TABBED1.Tab_Set(2)
                :SubSet:BUTTON1.activate()
                a_tbl = table.current()
                query.order = ""
                query.filter = ".T."
                query.options = "I"
                a_tbl.query_create()
                update.fields = 1
                update.field1 = "CVLTRLOGIL"
                update.expr1 = "IF(VAL(ITEM)=1,.T.,.F.)"
                a_tbl.update()

                Thanks

                B

                Comment


                  #9
                  RE: Global updates and queries

                  Bob, that's better.

                  How are you running your query? This code runs a query which selects all records. (Query.filter = ".T.")

                  How about using Query by Form to select a subset of your records, and then running the saved update operation from the button ? If we could then see the script which the recorder captures we'll be making progress.

                  -- tom

                  Comment


                    #10
                    RE: Global updates and queries

                    Bob, on second thought why not zip the whole database and send it here? Please include a narrative description of the filter or query you want to run before doing the update.

                    -- tom

                    Comment


                      #11
                      RE: Global updates and queries

                      Tom

                      I'm attaching zipped file.

                      I'm still in process of converting to v4 and have not deleted excess forms. Name of form I'm working on is SubSet.
                      Query name is temp substr(req_numb,1,2) condition t4.

                      I'm attempting to run update a logical field to true or false. One button for each.


                      Thanks

                      B


                      Rignt now I'm trying to attach the file -- bear withme.

                      Comment


                        #12
                        RE: Global updates and queries

                        Tom

                        I'm attaching zipped file.

                        I'm still in process of converting to v4 and have not deleted excess forms. Name of form I'm working on is SubSet.
                        Query name is temp substr(req_numb,1,2) condition t4.

                        I'm attempting to run update a logical field to true or false. One button for each.


                        Thanks

                        B


                        Rignt now I'm trying to attach the file -- bear withme.

                        Zipped file to large. I will eliminate some of the records and retry in the AM

                        Thanks

                        B

                        Comment


                          #13
                          RE: Global updates and queries

                          Robert,

                          here's a small example that shows how a 'selective' update operation to a logical field might be implemented on a form. I think you'll find it self explanatory. Let me know if you have questions.

                          -- tom

                          Comment


                            #14
                            RE: Global updates and queries

                            Tom

                            Thanks. I've been playing with the database you provided. I was able to replicate the raise flags, I'm not certain why it works. I can't see any differences in the operations setting the value to .f. or .t. or the actions. The inline xbasic looks the same"parentform:browse1.refresh()" and the options appear the same on the code editor "operations" filter and order.

                            What have I missed?

                            Thanks again.

                            B

                            Comment


                              #15
                              RE: Global updates and queries


                              Go to the control panel; select the operations tab; open each saved operation in design mode. You'll see the differences pretty quickly.

                              -- tom

                              Comment

                              Working...
                              X