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

Losing records in a browse

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

    Losing records in a browse

    Hi,

    I developed an application which seems to be losing child records as they are added into a browse on a form. The browse is on a 7 tabbed tab form. The records are in a set with a one to many link. The linking field is transaction number (parent field rule auto-increments this) and the child linking field is also transaction number.

    There are also "CanSaveRecord" events in the field rules, which automatically add store and date information from parent field, and there is an "OnSaveRecord" event which writes the record to another table when the expense_type is a particular type. The records are disappearing even when the expense_type does not trigger the OnSaveRecord event.

    Is the CanSaveRecord preventing the record from being saved?

    Barry Rochford sent me an ErrorTrapping script which I have not yet tried, but I am not getting an error when the record disappears. Shouldn't the CanSaveRecord event produce and error?

    Thanks for the help and happy labor day.

    Regards,

    Jay Talbott
    Jay Talbott
    Lexington, KY


    #2
    RE: Losing records in a browse

    Hi Jay,

    May we assume that if you open the child table independently the records are not there? That is, it is not merely a display problem.

    Bill
    Bill Hanigsberg

    Comment


      #3
      RE: Losing records in a browse

      Jay, if none of your child table records are being saved I'd imagine the problem is with the CanSaveRecord event for the table.

      Are you trying to reference fields in other tables inside the child table's event field rules? Is this possible, since the table's rules are tied to the table and not the set?

      Comment


        #4
        RE: Losing records in a browse

        Bill,

        You are correct. Opening the child table independently reveals no new records added nor any deleted. (In other words, it is not a display problem).

        Tom,

        You are also correct. The CanSaveRecord references the parent table of the set in order to put the store name and the date of the transaction into the child record. Sales.dbf is the parent table. The field rule says something like:

        t=table.current(6) 'referencing the 5th child table
        t.store=sales->store
        t.date=sales->date

        I do not even remember why I did this. The tables are linked by the transaction number and this rule is probably what is killing me.

        What do you think?

        Jay
        Jay Talbott
        Lexington, KY

        Comment


          #5
          RE: Losing records in a browse

          Jay,

          If all you want to do is stuff in a couple of values why wouldn't you merely write a calculated field rule? If necessary, this could be conditional.

          I have had good luck with this approach. If the expression has to include variables declare them in the table structure screen with reasonable defaults supplied so the rule always compiles properly.

          Bill
          Bill Hanigsberg

          Comment


            #6
            RE: Losing records in a browse

            Bill,

            Thanks for the advice. I will do that when I get to the client's place on Tuesday. Have a nice (Canadian version of)Labor Day.

            Jay
            Jay Talbott
            Lexington, KY

            Comment


              #7
              RE: Losing records in a browse

              Jay, I'm not certain the field rule is even aware that the table is in a set. It's my understanding that the field rule is 'local' to the table, and that indirect references to other tables that may or may not be linked by a set are inappropriate. Has anything like this ever worked for you?

              The script you describe would make sense if the 'set' had its own field rules, but in Alpha Five there is no such thing.

              -- tom

              Comment


                #8
                RE: Losing records in a browse

                You can use a default field rule with and lookupc() or other lookup expression in the child table to copy information from the parent.

                Comment


                  #9
                  RE: Losing records in a browse

                  Ohlen, I agree. Lookupc() would use a direct or absolute reference to the external table. Jay's script uses table.current() to try to obtain a pointer to the external table based upon its position in a set. This depends on the context of the current form and is what I meant by an indirect reference to the external table's name.

                  -- tom

                  Comment


                    #10
                    RE: Losing records in a browse

                    Hi Tom,

                    I think you've put your finger on it. Something is supposed to happen and doesn't and since the code is attached to the can_save the record doesn't save whether or not any condition in the code is met because the code itself won't run.

                    But........

                    Look at Peter Wayne's article entitled "Numbering Browse Lines."

                    The article uses field rule code attached to the child table's on_save. But since numbering child records makes no sense if there is no parent table his code tests for the parent using table_get rather than table_current. If table_current comes up empty he generates and error and ends because there is no active set.

                    The script is neither long nor complex but it is subtle and it is extensible to other situations. Close study will be repaid with interest.

                    Bill
                    Bill Hanigsberg

                    Comment


                      #11
                      RE: Losing records in a browse

                      Hi Tom,

                      I'm not sure why James wants to use event coding in this case since the default field rule and a lookupx() expression works so easily to do this. As soon as you start a new record in the browse, the link is created to the parent. Then just as immediately (ok, just as almost immediately), the default field rule populates the child record with the fields from the parent and you're ready to go with the rest of the field entry.

                      Comment


                        #12
                        RE: Losing records in a browse

                        Ohlen,

                        I agree with you (and others) that a lookup() field rule would have been much better. This mistake has caused me countless hours of frustration, lost revenue, and a general case of lack of self-confidence.

                        While exposing my errors to the "Alpha troops" is a bit embarassing, this experience has been very helpful, and that which does not kill us makes us stronger. I will eliminate the script from the field rules, replace it with a calculated field lookup rule, and send each of the respondents to this message a $100 bill. (William, yours will be $150 Canadian.) Actually, in keeping with this technology, I will scan and email it to all of you. Thanks again. I will report my results on Tuesday.

                        Regards,

                        Jay
                        Jay Talbott
                        Lexington, KY

                        Comment


                          #13
                          RE: Losing records in a browse

                          Jay,

                          Don't feel bad, exposing "Alpha errors" and getting help is what makes this a unique product for amatuers and professionals alike. There is constant learning with this program; no matter how much one knows, someone else knows something you don't. Plus, there are so many ways to do the same thing; some better in one instance, others better in the other instance. I've made a routine visit(s) to this WEB site a regular part of my day.

                          Professional programmers like Ira, Bill, Tom and others regularly donate their time to helping others. Some are so prolific at answering our calls for help, I don't know how they get any real work done. But I'm thankful for their presence here.

                          Ira has announced an upcoming conference in March, 2002. I found the last one to be great fun for an amatuer and a super learning process. I hope you can make it and expose more of your "Alpha errors" to the joint learning process.

                          Regards,
                          Ohlen

                          Comment


                            #14
                            RE: Losing records in a browse

                            $100 US = $4 billion Cdn.

                            The $10.00 tomato is on the horizon!

                            To be serious for a sec, the best thing about this forum is the open good-heartedness of the collaboration unlike in academia which tends to be a nest of vipers.

                            I think programming is a bit like trying to raise children in that it keeps you humble.

                            Bill
                            Bill Hanigsberg

                            Comment


                              #15
                              RE: Losing records in a browse

                              Bill,

                              Well said!

                              -- tom

                              Comment

                              Working...
                              X