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

Refresh display and refresh objects - I thought I knew what they did

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

    Refresh display and refresh objects - I thought I knew what they did

    I don't understand why these don't work as described. Or am I the problem?

    I set up an OnSave event for a form. First I capture the variable that allows the current record to be updated.

    Next I use Xbasic Change Record to update three fields, one for date, another for time, and another for user name.

    Next I have the Refresh display or Refresh objects action (I tried it both ways). It does not refresh the display or objects (the three fields) for their new values. If I just go to the next record and come back, the new values are displayed.

    The description of Refresh Display in current form at parent level is "Refresh the values in all controls on the form." What am I missing?

    Jeff

    #2
    Re: Refresh display and refresh objects - I thought I knew what they did

    You want an inline xbasic

    parenform.resynch()

    to refetch changed table values.
    There can be only one.

    Comment


      #3
      Re: Refresh display and refresh objects - I thought I knew what they did

      Jeff, remember you can always zip a copy of the database and upload it here for our review.

      If this is a continuation of the thread we were discussing yesterday I'm surprised you're using the onSave event of the form. Was not among the suggestions I gave you.

      Comment


        #4
        Re: Refresh display and refresh objects - I thought I knew what they did

        Originally posted by Stan Mathews View Post
        You want an inline xbasic

        parenform.resynch()

        to refetch changed table values.
        Stan,

        I'm sure you know that parentform.resynch() will work and I will try it and I will be happy that it works. But, I don't understand why the refresh display doesn't do exactly the same thing. Do you know why? Is it just a broken feature that is sitting there to confuse people?

        Anyhow, if you know what's behind this mystery, I would love to hear about it.

        Thanks for your help.

        Jeff

        Comment


          #5
          Re: Refresh display and refresh objects - I thought I knew what they did

          Originally posted by Tom Cone Jr View Post
          Jeff, remember you can always zip a copy of the database and upload it here for our review.

          If this is a continuation of the thread we were discussing yesterday I'm surprised you're using the onSave event of the form. Was not among the suggestions I gave you.
          Tom, I know what you're saying. After meeting with my client yesterday afternoon, the option to show the lastuser, lasttime, and lastdate in the child region is not an option. The client wants to see the updates in the parent whenever a change is made in either the parent or child records.

          I first disabled the calculated field rules of the three fields in the parent (which worked well to show changes at the parent level, but I needed to update those fields when changes are made in the child, and you said I couldn't do that if they were calculated fields). I figured that OnSave would be a decent trigger event since it's really what I'm trying to do -- update those fields anytime a save is performed. I guess I could also do an OnChange, but in looking at your suggestions from yesterday:

          "Jeff, if it were me, I'd look at attaching a script to an event that fires when a change or enter is saved in the child table. Events are available in the embedded browse, and also in the "record events" section of the field rules for the child table. The script would set the desired field values in the related parent table record, and commit those changes to disk. ", it does seem to suggest OnSave. I would have approached it this way once I satisfied myself that the parent changes are working properly. In other words, I see it as being in two parts: first is the simple updating of the fields when a save is performed at the parent level. This works except for the screen refresh, which I hope will be solved with Stan's suggestion. I will then address the child table changes to update the parent fields. I hope I'm not setting myself up for a clash between the two.

          As for zipping up anything in the application, it would violate a confidentiality agreement.

          Thanks.

          Jeff

          Comment


            #6
            Re: Refresh display and refresh objects - I thought I knew what they did

            Originally posted by Jeff Fried View Post
            Stan,

            I'm sure you know that parentform.resynch() will work and I will try it and I will be happy that it works. But, I don't understand why the refresh display doesn't do exactly the same thing. Do you know why? Is it just a broken feature that is sitting there to confuse people?

            Anyhow, if you know what's behind this mystery, I would love to hear about it.

            Thanks for your help.

            Jeff
            Stan,

            I tried it two ways: parentform.resynch() and again with the table name: parentform.Resynch("temp.dbf")

            Neither worked. Is there something else I should know? The values are there. I had to leave the record and come back to see the updated values. I assumed parentform.resynch() is supposed to do this for me.

            Jeff

            Comment


              #7
              Re: Refresh display and refresh objects - I thought I knew what they did

              This script works for a button.

              tbl = table.current()
              tbl.change_begin()
              tbl.id = "Made a change"
              tbl.change_end()
              parentform.Resynch()

              Not sure what else you might have going on in your form events.
              There can be only one.

              Comment


                #8
                Re: Refresh display and refresh objects - I thought I knew what they did

                Originally posted by Stan Mathews View Post
                This script works for a button.

                tbl = table.current()
                tbl.change_begin()
                tbl.id = "Made a change"
                tbl.change_end()
                parentform.Resynch()

                Not sure what else you might have going on in your form events.
                Well, this does work with a change. I first tried it as you have it but the tbl.id line produced an error message. I excluded this line and it worked. I then wondered what would happen if I also excluded the change_begin and change_end and it did not work. So I ended up with what you have except for the tbl.id line. My guess is the same script that has the resynch also needs to have the change to which resynch will apply. Just a guess.

                So my question, rhetorical as it is, is why can't Alpha's simple parentform.resynch() act as if it had the other lines. How did you originally know that you should add the other lines to make parentform.resynch() work? You probably don't remember, but it gets very frustrating with not just this but many other Alpha Five procedures, functions, commands, etc. when you think logically about employing them and sometimes it just doesn't work the way you would expect. I think Alpha Five is a wonderful development tool, but I find it often falls short in the logic and syntax department. I never have this kind of problem with other languages such as Visual Foxpro where the syntax is exactly the way they state it.

                I would love to know what the Alpha people would say about this very example. Why, I would ask, does parentform.resynch(), which states clearly what it is supposed to do, fail at doing what it's supposed to do? Are there exceptions that they fail to let you know about, such as "make sure you set the table to table.current(), then begin a change, then end the change, then perform the resynch()". It was a total waste of time for me to play with this for a while, then to throw it out to my fellow Alphaholics, then waste your time and Tom's time helping me (which I greatly appreciate, now and every time you all have jumped in to help out), when things as simple and straightforward on the surface end up being anything but simple and straightforward.

                Anyhow, I do appreciate your coming up with a workable solution to my problem. Now I can move on.

                Jeff

                Comment


                  #9
                  Re: Refresh display and refresh objects - I thought I knew what they did

                  Jeff
                  I just took a look at " Xbasic Change Record" out of interest, never have used it.
                  I use exactly what Stan laid out in #7
                  that is using the currently open table.
                  In any event the answer is possibly, from what I see, that Xbasic change record opens another instance of the table.
                  Could that explain that having to close and re-open?

                  EDIT - you replied already.

                  Comment


                    #10
                    Re: Refresh display and refresh objects - I thought I knew what they did

                    Originally posted by Ray in Capetown View Post
                    Jeff
                    I just took a look at " Xbasic Change Record" out of interest, never have used it.
                    I use exactly what Stan laid out in #7
                    that is using the currently open table.
                    In any event the answer is possibly, from what I see, that Xbasic change record opens another instance of the table.
                    Could that explain that having to close and re-open?

                    EDIT - you replied already.
                    I suppose that could be the explanation. But it begs the question, when does parentform.resynch() work as intended?

                    Thanks.

                    Jeff

                    Comment


                      #11
                      Re: Refresh display and refresh objects - I thought I knew what they did

                      How did you originally know that you should add the other lines to make parentform.resynch() work?
                      Ths other lines work for my table because it has an id field.


                      tbl = table.current() 'get a pointer to the currently open table
                      tbl.change_begin() 'put that table in change mode
                      tbl.id = "Made a change" 'write a value to the id field in that table
                      tbl.change_end() 'commit the change
                      parentform.Resynch() 'refetch the table fields and display any changed values in their form objects

                      I was showing you that the parentform.resynch() does work.
                      There can be only one.

                      Comment


                        #12
                        Re: Refresh display and refresh objects - I thought I knew what they did

                        Originally posted by Stan Mathews View Post
                        Ths other lines work for my table because it has an id field.


                        tbl = table.current() 'get a pointer to the currently open table
                        tbl.change_begin() 'put that table in change mode
                        tbl.id = "Made a change" 'write a value to the id field in that table
                        tbl.change_end() 'commit the change
                        parentform.Resynch() 'refetch the table fields and display any changed values in their form objects

                        I was showing you that the parentform.resynch() does work.
                        Oh, of course. I wasn't thinking. Well, it works without actually making a change. The change takes place before I get to this code. Maybe I'll just combine the code into one. Makes sense.

                        Thanks again.

                        Jeff

                        Comment


                          #13
                          Re: Refresh display and refresh objects - I thought I knew what they did

                          Originally posted by Jeff Fried View Post
                          Oh, of course. I wasn't thinking. Well, it works without actually making a change. The change takes place before I get to this code. Maybe I'll just combine the code into one. Makes sense.

                          Thanks again.

                          Jeff
                          Stan,

                          I just combined the code, per your layout, and I reduced it to one simple inline basic instruction. Very nice.

                          You don't happen to have a way to sense a change in the parent table when a change is made in the child, do you? Have you ever done it? For example, I have 3 fields to update when a change is made to the parent record. The current date, time, and user populate those three fields. I have the code we just discussed in the OnSave event for the form, and it works fine. Before I had each of the three fields as calculated fields which updated to date, time, and user any time there was a form change, but I made them straight user entered fields and use the table change code to make it work.

                          I want to be able to update these three fields, located in the parent table, when something changes in the child table. I have ideas how to do it, but if you've already invented that wheel, I would love to hear your version.

                          Thanks.

                          Jeff

                          Comment


                            #14
                            Re: Refresh display and refresh objects - I thought I knew what they did

                            Jeff the msg board works better as a knowledge base if we all resist turning a single thread into a blog. Please try to limit each thread to a single question or topic. Thanks.

                            Comment


                              #15
                              Re: Refresh display and refresh objects - I thought I knew what they did

                              I feel that its still the same topic Tom, "Refresh display and refresh objects" on a form when a child record changes.
                              Still a question hanging, I am interested in ideas on that here, or if a new thread is started, either way.

                              Comment

                              Working...
                              X