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

Form View and Last Record

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

    Form View and Last Record

    Hi,
    How do you open a form and display the last record when you use the Form.view("form_name") function?

    If result ="List_name" then
    form.view("form_name") and Last Record?

    #2
    Re: Form View and Last Record

    I prefer using Form.load(). In pseudo code the sequence would be:

    a) load the form, hidden
    b) set the desired index primary (after all "last" has no meaning absent a sort sequence)
    c) fetch the last record
    d) show the form
    e) activate the form

    Very easy.

    Comment


      #3
      Re: Form View and Last Record

      Hi John,

      See <TBL>.FETCH_LAST() in the help file.
      Regards
      Keith Hubert
      Alpha Guild Member
      London.
      KHDB Management Systems
      Skype = keith.hubert


      For your day-to-day Needs, you Need an Alpha Database!

      Comment


        #4
        Re: Form View and Last Record

        Tom and Keith

        Thank you. I think I should mention the Ui_Popup_menu(). I am working the "Menu"

        HTML Code:
        menu = <<%str%
        
        Contract
        Change Order
        Work Schedule
        Customers
        %str%
        
        result = ui_popup_menu(menu)
        
        if result = "customers" then 
        	form.view("Customer")
        else if result = "contract" then 
        	form.view("ContractsList")
        else if result = "work Schedule" then 
        	form.view("workschedule") ..... End If

        Comment


          #5
          Re: Form View and Last Record

          I found another way.
          I used the "Goto last record" on OnIt Form Event so that a form opened and displayed the last record.

          Comment


            #6
            Re: Form View and Last Record

            Originally posted by johnkoh View Post
            I found another way.
            I used the "Goto last record" on OnIt Form Event so that a form opened and displayed the last record.
            Remember that the "Goto last record" is relative to the current index.

            Hence Tom's suggestion to set the index......

            Choose wisely grasshopper.... ;)
            Al Buchholz
            Bookwood Systems, LTD
            Weekly QReportBuilder Webinars Thursday 1 pm CST

            Occam's Razor - KISS
            Normalize till it hurts - De-normalize till it works.
            Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
            When we triage a problem it is much easier to read sample systems than to read a mind.
            "Make it as simple as possible, but not simpler."
            Albert Einstein

            http://www.iadn.com/images/media/iadn_member.png

            Comment


              #7
              Re: Form View and Last Record

              Al,
              Thank you.
              But sometime, I just need the "simple" way.

              I do not know about beyond of the "Current index".
              I want to open a form and go to a last record.
              Does "current index" have some other matter in order open a form?

              Comment


                #8
                Re: Form View and Last Record

                Originally posted by Tom Cone Jr View Post
                b) set the desired index primary (after all "last" has no meaning absent a sort sequence)
                Originally posted by johnkoh View Post
                I found another way.
                I used the "Goto last record" on OnIt Form Event so that a form opened and displayed the last record.
                As Tom and I are trying to explain, 'last record' does not tell Alpha enough information.

                For every table there is at least one last record and can be as many as the number of indexes/queries plus one.

                So the 'last record' definition and action is dependent on the index/query that is currently being used. These are choices that the user or programmer may change as the system is used. So you need to define which 'last record' you mean.

                You do that by choosing the index or query that defines the sort order that you intend to be active when the 'last record' is chosen.

                Or you can choose the record number sequence and get the last chronological record (or last physical record )

                To rely on chance that the expected index is in play is to play russian roulette and lose.

                Look at action scripting - Index/Sort - Set Index

                That will start you on the proper path.
                Al Buchholz
                Bookwood Systems, LTD
                Weekly QReportBuilder Webinars Thursday 1 pm CST

                Occam's Razor - KISS
                Normalize till it hurts - De-normalize till it works.
                Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                When we triage a problem it is much easier to read sample systems than to read a mind.
                "Make it as simple as possible, but not simpler."
                Albert Einstein

                http://www.iadn.com/images/media/iadn_member.png

                Comment


                  #9
                  Re: Form View and Last Record

                  Al,

                  I appreciate the value of your tour.

                  I did not know it. I want to stay
                  Code:
                  That will start you on the proper path.

                  Comment


                    #10
                    Re: Form View and Last Record

                    Yes, Al is right (again). If the sort sequence (index) for the table is "record number" means the record with the highest (largest) record number. If the sort sequence (index) is last_name (ascending) the last record is last in A to Z order. If the sort sequence (index) is by date, then... well you get the picture. Our problem is that you know what "last record" means, but you haven't told us. So my pseudo code supplies a generic solution that will always work.

                    Comment


                      #11
                      Re: Form View and Last Record

                      I felt the need to add a bit to this (yeah, I know...when don't I feel the need!!).

                      I like this thread as it is one of the first I have read in the past few years that actually attempted to explain something that is virtually always assumed that people know about...that is, in regard to indices.

                      But even though Al and Tom have explained a lot, I think a complete newbie to programming would still be at a loss.

                      To put it in a very basic way, an index could be thought of being analogous to an index you find for books, encyclopedias, etc. . It is an order of a list that helps you (Alpha) find things faster. And you can have many indices created for the same list in order to find whatever you are looking for at different times to speed the looking process up.

                      An index can be created directly from within the table (right click on a table, choose Define Indexes) or dynamically with xBasic or Action Script. Alpha will many times create an index automatically when you have created filters and such.

                      Many users may not create any indices of their own, but without them it can make it much more difficult to code correctly as Tom and Al have pointed out....that and there are many functions that require or will be faster with an index and so a user who does not know about them will be limiting themselves severely at times.

                      Have fun!
                      Mike
                      __________________________________________
                      It is only when we forget all our learning that we begin to know.
                      It's not what you look at that matters, it's what you see.
                      Henry David Thoreau
                      __________________________________________



                      Comment

                      Working...
                      X