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

Browse Table Item Number

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

    Browse Table Item Number

    I can't figure out how to add a calculated or system field to show the "Item Number" in an embedded browse in a form for a Set with a 1 to Many link. The Browse has the Many fields.

    Alpha 4 had a system field "System->Reg_RecNum" for this, but Alpha 5 doesn't seem to have this.

    Any ideas on how to create something like this?

    #2
    Re: Browse Table Item Number

    Sounds like you are looking for the record number.
    You could see that at the toolbar at the bottom, but if you want to include it in the browse itself, create a calc field:
    calc_field=recno()

    Not sure though what do you need it for.

    Comment


      #3
      Re: Browse Table Item Number

      G,
      I think he wants a running count of the records in a browse when filtered?

      create a calculated field with this code, and place this calculated field into the browse.

      Code:
      Recs = iif(table.current().eof(),run_count([COLOR="Red"]tablename->tablefieldvalue[/COLOR])+1,run_count([COLOR="red"]tablename->tablefieldvalue[/COLOR]))
      Mike W
      __________________________
      "I rebel in at least small things to express to the world that I have not completely surrendered"

      Comment


        #4
        Re: Browse Table Item Number

        I'm creating an invoice that needs an identifier for each line item. All of Alpha's example DBs I've looked at don't have this.

        I'll try your solution & see how it works.

        Comment


          #5
          Re: Browse Table Item Number

          Mike W

          Your solution sort of worked, it created a sequential identifier for the Browse but it didn't reset when I went to a new record & start with item 1 again. The first record in the parent table had 4 Items (which showed correctly) but the 2nd parent records' Browse items started with 5

          Comment


            #6
            Re: Browse Table Item Number

            There was an old..old..I mean really old thread in which someone asked the same question and I attached a zip file with an example. If you can't find it, I will re-do it.

            Comment


              #7
              Re: Browse Table Item Number

              G Gabriel

              I don't know what words or term to search on for your old post. If you can dig it up or redo, I would appreciate it.

              Comment


                #8
                Re: Browse Table Item Number

                Just to be sure I understand you correctly:
                You want:
                1-A clolumn at the embedded browse to show a sequential number of the rows in the browse, i.e. 1,2,3,...
                2-If you delete a row or add a new one, these numbers will re-adjust. So, if you delete row #2, Row #3 become 2 and row#4 becomes 3 and so on..
                3-When you start a new parent, you will start from #1

                All I could remeber about that old thread is that the person who asked the question was a pilot and needed it for a flight application.

                I will see if I could redo it after the Saints beat the Falcons.

                Comment


                  #9
                  Re: Browse Table Item Number

                  G Gabriel

                  That is exactly what I want to do. A4 made it simple but A5 thru out the baby with the bath water. Progress right?

                  Hope your team wins. Mine did yesterday - go Gators.

                  Comment


                    #10
                    Re: Browse Table Item Number

                    Ready for Oklahoma?
                    Last edited by G Gabriel; 12-07-2008, 11:59 AM.

                    Comment


                      #11
                      Re: Browse Table Item Number

                      What am I thinking!
                      The example I did back then was during the Ice-age before run_count() was available.
                      Try this:
                      Create a calc field:
                      x=run_count(..put here any field from the child table..)
                      Place x in the embedded browse.

                      Comment


                        #12
                        Re: Browse Table Item Number

                        Bingo !!

                        I had to add GRP->parent_table to Run_Count(). I got it to work. Added embedded records, deleted embedded records - everything seems OK.

                        Many thanks for your help.

                        Oklahoma (or whoever) can figure out what to do with Tebow, they may be in the ball game.

                        Comment


                          #13
                          Re: Browse Table Item Number

                          Wayne,
                          check the last and the penultimate records. Using the simple run_count(fieldname) will have them both the same. The code I gave accomodates for that. It should work. Do not give up on it. You might need a browse refresh somewhere.
                          Mike W
                          __________________________
                          "I rebel in at least small things to express to the world that I have not completely surrendered"

                          Comment


                            #14
                            Re: Browse Table Item Number

                            Hi Wayne,

                            Here is the code I use in field rules, Record Events, OnSaveRecord.

                            line_number=0
                            on error goto not_in_set
                            head=table.get("temp2_2") 'the parent table in the set - if you ran this outside of the set
                            'it would renumber all invoice line items
                            items=table.get("invoice2")
                            if items.records_get() = 0 'there are no line items for that invoice
                            end
                            end if
                            items.fetch_first()
                            while .not. items.fetch_eof()
                            line_number=line_number+1
                            items.change_begin()
                            items.line_number=padl(ltrim(str(line_number,2,0)),2,"0")
                            'linenumber is a new 2 digit character field in invoice items - you are limited to 99 items for one invoice
                            'if you want more increase the width of the field and the padl() syntax
                            items.change_end(.t.)
                            items.fetch_next()
                            end while
                            end
                            I would be interested to see how you have done it.
                            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


                              #15
                              Re: Browse Table Item Number

                              Keith, here's G's idea, implemented for the Invoice form in AlphaSports:

                              Code:
                              'Running Count for items in the Invoice_items browse on the 
                              'AlphaSports Invoice form 081208
                              
                              'This is the calc display field expression.
                              'You would add this calc display field to the Invoice_items browse after
                              'defining it in the form.
                              '
                              Item_count = run_count(Invoice_Items->Product_Id,GRP->INVOICE_HEADER)

                              Comment

                              Working...
                              X