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 Active Link

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

    Refresh Active Link

    Hi All

    I must say that V9 is yet another great step forward some great new features.

    I have taken one of V8 apps and tried to recreate it in V9.

    I exported dbf's to mysql,
    reimported from mysql to active links with sql_ prefix,
    copied my forms to new sql active links
    amended a few scripts

    all took just a couple of hours.

    One small problem I have is:

    How do I refresh a active link table within a script.

    my script works fine but additions to the table do not get reflected in the form until I close the from and reopen it.

    Andy
    script below

    Code:
    DIM tbl AS P
    DIM vImageFilename AS C
    DIM vOld_Path AS C
    DIM vPath AS C
    DIM vFiles AS P
    Dim Shared vExt as C
    Dim prod as c
    
    tbl = table.open("sql_webproducts2")
    
    vOld_Path = dir_get()
    vPath = UI_GET_PATH ("Enter Path","c: ", "c:\\")
    
    
    If vPath = ""
    	End
    End if
    
    DIR_put(vPath)
    
    vFiles = filefind.first(vExt,FILE_FIND_READONLY)
    
    
    while .not. vFiles.eof()
        vImageFilename =vFiles.name()
    	tbl.enter_begin()
    	myimage = rtrim(vImageFilename,vExt)
    	'myimage = file.filename_parse(vImageFilename,"N")
    		tbl.image_name = left(myimage,15)
    		tbl.Full_address = vpath+vImageFilename
    		tbl.Cd_number = CDno
    		'tbl.Picture = image_filename_encode(vpath+vImageFilename)
    	tbl.enter_end(.t.)
    	
    	xbasic_wait_for_idle()	 
    
    	StatusBar.robot()	
    vFiles.next()
    end while
    
    DIR_put(vOld_Path)
    
    tbl.close()
    Parentform.resynch()
    
    end

    #2
    Re: Refresh Active Link

    Originally posted by [email protected] View Post
    Hi All

    I must say that V9 is yet another great step forward some great new features.

    I have taken one of V8 apps and tried to recreate it in V9.

    I exported dbf's to mysql,
    reimported from mysql to active links with sql_ prefix,
    copied my forms to new sql active links
    amended a few scripts

    all took just a couple of hours.

    One small problem I have is:

    How do I refresh a active link table within a script.

    my script works fine but additions to the table do not get reflected in the form until I close the from and reopen it.

    Andy
    script below

    Code:
    DIM tbl AS P
    DIM vImageFilename AS C
    DIM vOld_Path AS C
    DIM vPath AS C
    DIM vFiles AS P
    Dim Shared vExt as C
    Dim prod as c
    
    tbl = table.open("sql_webproducts2")
    
    vOld_Path = dir_get()
    vPath = UI_GET_PATH ("Enter Path","c: ", "c:\\")
    
    
    If vPath = ""
    	End
    End if
    
    DIR_put(vPath)
    
    vFiles = filefind.first(vExt,FILE_FIND_READONLY)
    
    
    while .not. vFiles.eof()
        vImageFilename =vFiles.name()
    	tbl.enter_begin()
    	myimage = rtrim(vImageFilename,vExt)
    	'myimage = file.filename_parse(vImageFilename,"N")
    		tbl.image_name = left(myimage,15)
    		tbl.Full_address = vpath+vImageFilename
    		tbl.Cd_number = CDno
    		'tbl.Picture = image_filename_encode(vpath+vImageFilename)
    	tbl.enter_end(.t.)
    	
    	xbasic_wait_for_idle()	 
    
    	StatusBar.robot()	
    vFiles.next()
    end while
    
    DIR_put(vOld_Path)
    
    tbl.close()
    Parentform.resynch()
    
    end

    you should never really have to refresh active links. the 'refresh active link' command on the menu is only meant to be used if you want to refresh the definition of the active link table should the schema of the backend table change, or should the connection string change (i.e. you have an active link table that came from mysql, but now it comes from oracle).

    every time you open an active link table it gets the current data in the server.

    Comment


      #3
      Re: Refresh Active Link

      Selwyn;

      The question still applies, how to reflect those additions in an open form without closing it?

      I wish to see a new Form (Browse) propertiy that has an AUTOMATIC REFRESH TIMER.
      Just set the timer and as long as the form is viewed and the data is being added to MySQL table it's refreshed in A5.

      Comment


        #4
        Re: Refresh Active Link

        Originally posted by Anis View Post
        Selwyn;

        The question still applies, how to reflect those additions in an open form without closing it?

        I wish to see a new Form (Browse) propertiy that has an AUTOMATIC REFRESH TIMER.
        Just set the timer and as long as the form is viewed and the data is being added to MySQL table it's refreshed in A5.
        You can hit the good old F5 key to refresh whenever you wish.

        Your suggestion of a timer would present a problem: Suppose you are in the process of editing a record (have not saved anything but have changed possibly a bunch of fields). While you were doing that, someone else made a change to the same record in the backend database and your timer automatically updates your form. Unless something new is added to what is currently in the beta, your changes would be history. Alpha would need to add something like what is there now when you try to save your changes and the record had already been changed by someone else, i.e., a warning and a way for you to reconcile your changes with those made by someone else. Or maybe the timer triggers a warning just that someone else has changed the record you are working on. Or something...?

        Ray

        Comment


          #5
          Re: Refresh Active Link

          well, interactively yes you can hit F5, but you want that to be automatic.

          If we add something like this it should be optional, if you do changes in A5 then you might not want to use it.
          In my case (and as I understand from many users) all the changes and additions are coming thru MySql not Alpha, so in this case there's no problem and could be used, like you said if they are changing a record thru A5 and used that automatic refresh, it should come up with a screen of warning.

          Comment


            #6
            Re: Refresh Active Link

            what i do is put a "Refresh" button on the form
            Cheers
            Mauricio

            Comment


              #7
              Re: Refresh Active Link

              How do you link that to a timer ?

              Comment


                #8
                Re: Refresh Active Link

                Originally posted by Anis View Post
                well, interactively yes you can hit F5, but you want that to be automatic.

                If we add something like this it should be optional, if you do changes in A5 then you might not want to use it.
                In my case (and as I understand from many users) all the changes and additions are coming thru MySql not Alpha, so in this case there's no problem and could be used, like you said if they are changing a record thru A5 and used that automatic refresh, it should come up with a screen of warning.
                I am not sure I made it clear: It does not matter whether the changes to a record are made "thru A5" or or through some other interaction with the backend DB, the issue is the same in both cases.

                I am sure one could build a form timer for F5 refreshing that would do pretty much what Alpha has built into saves, but this would not deal with browse changes and assuming it makes sense in the first place we should not have to build this kind of thing ourselves anyway.

                Ray

                Comment


                  #9
                  Re: Refresh Active Link

                  Originally posted by Anis View Post
                  How do you link that to a timer ?

                  Put this in the OnTimer event:
                  Code:
                  sys_send_keys("{F5}")
                  Set the form's OnTimer interval to whatever you want.
                  Peter
                  AlphaBase Solutions, LLC

                  [email protected]
                  https://www.alphabasesolutions.com


                  Comment


                    #10
                    Re: Refresh Active Link

                    Thanks Peter

                    Comment


                      #11
                      Re: Refresh Active Link

                      Originally posted by Peter.Greulich View Post
                      Put this in the OnTimer event:
                      Code:
                      sys_send_keys("{F5}")
                      Set the form's OnTimer interval to whatever you want.
                      To make sure no one misses what I said above in regard to this, I am going to repeat it:

                      "Suppose you are in the process of editing a record (have not saved anything but have changed possibly a bunch of fields). While you were doing that, [suppose] someone else made a change to the same record in the backend database and your timer automatically updates your form. Unless something new is added to what is currently in the beta, your changes would be history."

                      Meaning, if still desired, the user would have to make the changes all over again. Maybe this would be OK for your users, but mine would scream bloody murder. What is needed, I think, is the same kind of warning that occurs now in v9 when saving changes to a record that someone else has changed since you started your edits, i.e., rather than just automatically and irretrievably wiping out all your changes on the refresh, upon attempting to refresh we need a warning that someone else has changed the record you are still working on and showing what that other user changed and giving you some options as to how to proceed. Does anyone see what I am getting at here--or am I missing something?

                      Ray

                      Comment


                        #12
                        Re: Refresh Active Link

                        Hi All

                        What I did to get around this problem, I ran my script above as a sperate operation from my Menu, Then when the user wants to view the images they open the form. So all links are available. No images can be added from the form.

                        PS. As anybody had a look at V9 HTML forms the advanced example is fantastic. I for one will be trying to learn this method

                        Andy

                        Comment


                          #13
                          Re: Refresh Active Link

                          You can also add a little more testing code to Peter's timer event to ensure the table(s) are not in change or enter mode using table.mode_get(). I use this method on our appointment form that needs refreshed to show the latest and greatest changes. It's tough to convince the users to refresh the form themselves before creating a new appointment. This seems to work well in our case. As long as no one is in the process of entering or editing a record the form refreshes. This is a form based on a three table set.

                          Code:
                          if parentform.Mode_Get()="VIEW" .and. tbl.mode_get() = 0 .and. tbl1.mode_get()\
                          	= 0 .and. tbl2.mode_get()=0 then
                              topparent.Command("REFRESH")
                          end if
                          Jim Coltz
                          Alpha Custom Database Solutions, LLC
                          A5CustomSolutions.com
                          [email protected]

                          Comment


                            #14
                            Re: Refresh Active Link

                            Thanks for everyone. I will test all this before I put it in production.

                            Comment


                              #15
                              Re: Refresh Active Link

                              Originally posted by Jim Coltz View Post
                              You can also add a little more testing code to Peter's timer event to ensure the table(s) are not in change or enter mode using table.mode_get(). I use this method on our appointment form that needs refreshed to show the latest and greatest changes. It's tough to convince the users to refresh the form themselves before creating a new appointment. This seems to work well in our case. As long as no one is in the process of entering or editing a record the form refreshes. This is a form based on a three table set.

                              Code:
                              if parentform.Mode_Get()="VIEW" .and. tbl.mode_get() = 0 .and. tbl1.mode_get()\
                                  = 0 .and. tbl2.mode_get()=0 then
                                  topparent.Command("REFRESH")
                              end if
                              OK, after this, I give up. You can do this to "show the latest and greatest changes" via your Alpha app before you start making changes. But what if you begin making changes and either at the same time or a bit later someone else also begins making changes and they are done (save them) before you? If the timer refresh then happens, all the changes you made will be wiped out before your very eyes (unless you are looking elsewhere and don't notice them!) and you will have to start all over. Plus, if your SQL DB is open to being changed by means other than Alpha Five (mine is subject to being updated by non-Alpha programs all the time), all the Alpha based .mode_get() stuff in the world is not going to accomplish what you are looking for here. I think you need to look at what has gone on at the SQL DB level, not the active link table level, and that would be best left to the programmers at Alpha Software, especially since they already have the basics of what, I think, would be needed in code that fires when an active link record is saved (see the video on "Optimistic Record Locking" in What's New in Alpha Five Version 9). If what needs to be done can in fact be done at the active link table level, it certainly would take more than mere .mode_get() code.

                              There. I am done with this thread unless someone can show me where I am wrong (always possible!), in which case I will apologize for being so dense.

                              Ray

                              Comment

                              Working...
                              X