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

Field Record Events

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

  • Field Record Events

    I posted this on the web board, with no response so I am trying here:-

    I am using / developing a UX with tabs to populate a dbf tab by tab.
    As each tab is completed the data is (re)submitted and certain Field Rules / Record events are fired.
    The problem is that I keep losing the Record Events when editing. Editing cansave the onsave events will disappear, which I don't see until the ux starts to show odd behaviour, so I then have to restore field rules & start again.
    What is the problem with the stability of the Field rules? - could be on the wrong board for this.
    Is my approach wrong in using this method, should I perhaps be firing some script from the UX, or something else/
    I am using a dbf as this is also part of our desktop system.
    Thanks
    Terry

  • #2
    Re: Field Record Events

    The field rules are stored in the dbf's data dictionary files.

    Data Dictionary
    .DDD
    The table's data dictionary, which contains lists of additional table objects such as Layouts (forms, browses, etc.), report designs, saved operations, field rules, and field names longer than 10 characters.
    Dictionary Methods, Reading From and Writing To the Data Dictionary

    .DDM
    Stores additional table objects such as Layouts (forms, browses, etc.), report designs, and saved operations in memo format.

    .DDX
    Contains the dictionary's index(es). Alpha Five uses the .ddx to find a specific form name or field rule or whatever is needed.
    So it seems something is messing with those files. Having no clue what a UX is or does I can't offer any advice.
    There can be only one.

    Comment


    • #3
      Re: Field Record Events

      Any suggestions on how I can fix these, I have already tried a compact but the problem still persists.
      Is there a way to delete all record events & then I could start building them again?
      I tried moving the code to a global script, and then running that script from the record event but that doesn't seem to work with the same code - perhaps someone could tell me what is wrong with this method.
      Thanks
      Terry

      Comment


      • #4
        Re: Field Record Events

        i do not do dbf nor desktop, since this is pertaining to ux/dialog in web application i am trying to answer the question:
        why don't you add code in the web side afterDialogValidate event on submitting the record to do what you want to do?
        if you post a screencast of the ux with tabs and how you are submitting the ux, i can try to think of some ideas for you to consider.
        thanks for reading

        gandhi

        version 11 3381 - 4096
        mysql backend
        http://www.alphawebprogramming.blogspot.com
        ggandhi344@gmail.com
        Skype:ggandhi344@gmail.com
        1 914 924 5171

        Comment


        • #5
          Re: Field Record Events

          Terry:

          It's not, I do not believe, an issue with the events themselves not firing. And I also don't think it's a stability issue with Alpha.

          Not to say Alpha doesn't have quirks, but I'm in one version or another of this software 6 hours a day for some 15 years. I'm not implying to be an expert - just that I've traveled this path a few times myself. It can be frustrating, as you already know, but Alpha itself is pretty stable.

          Now, let's focus on the quirks in the events overlay.

          Getting a group or series of events to work harmoneously can be trying, and this is, my guess, where your issue is.

          It's not you, or your fault, by the way. Anyone with a flow of events at the form, field, and record level can experience this.

          Some issues are documented, as exampled, a Can event (cancel()) can be tricky to get to work, as anything changing focus resets an internal variable in Alpha so the cancel() never takes place.

          From my own experience, I find that by adding a few ui_msg_boxes, and using the Trace window can help to isolate where the flow of events is being disrupted. The problem can also be a form event disrupting a record or field event.

          Start by looking at any Cancel() events, and look to see if there may be a msg box or .Activate that prevents the cancel.

          Try writing down what the true sequence of events should be (Flow Chart), the determine at what point it deviates from that path by adding msg boxes or writing to the trace window. Then, look at the code in that area and try alternating your logic.

          Patience will get you through this....

          Comment


          • #6
            Re: Field Record Events

            Re-reading your post, I have had field and record events disappear, too. They are still there, and re-appear after a compact or closing / re-opening Alpha.

            I guess it's a bit early for me, as I didn't pick up that your talking web components here in the desktop board. I found, in my expereiences with web components and field rules, that the two are not meant to be paired. While some field rules are enforced, others are not, for example.

            Take my prior post and shelve it... you probably need to limit any data enforcement to the component level on the web side.

            Comment


            • #7
              Re: Field Record Events

              To add some clarity
              The UX reference is perhaps a red herring
              The field record events are working fine.
              My issue is that when I edit the field record events I experience the loss of them I.e if I edit cansave & save the field rules, they save but the existing onsave events disappear.
              This is either a problem with the table (I have tried compacting) or it is a bug.
              I hope this aids those who are trying to help me.
              Thanks

              Comment


              • #8
                Re: Field Record Events

                My issue is that when I edit the field record events I experience the loss of them I.e if I edit cansave & save the field rules, they save but the existing onsave events disappear.
                actually, this should have been in the database design forum, few forums down.
                there are many people who are experts in desktop side and i am sure you will get an answer.
                good luck.
                thanks for reading

                gandhi

                version 11 3381 - 4096
                mysql backend
                http://www.alphawebprogramming.blogspot.com
                ggandhi344@gmail.com
                Skype:ggandhi344@gmail.com
                1 914 924 5171

                Comment


                • #9
                  Re: Field Record Events

                  Like Stan, I do not do web programming, and I do not even know what a UX component is. And I also don't know if you are using DBF's or SQL.

                  However, to use field rules in DBF's, there are certain things you need to know and understand. Mainly, and most importantly (if you are using the cansaverecord event or the canwritefield events) is where is the data.

                  You have a hard drive that contains records for a table.
                  When you are entering or editing a given record, before it is saved the new changed data is not on the hard drive; it is in a record buffer in memory.

                  And if, in the cansaverecord event, you say in code "if such-and-such is true then cancel (don't save the record) and alert the user that they have made a mistake, and their changes were not saved" - then those changes will not be written the hard drive.

                  However, if you are using the canwritefield event, it is different. Since the field has not yet been written to the record in the buffer, where is it? It is in a_field_value.value. And at this point you do not want it to get to the record buffer in memory. And you cannot reference the field itself, you have to reference a_field_value.value.

                  In other words, you could not say
                  t=table.current()
                  if t.first_name is "Mary" - because you would referencing the value in the record buffer, not the field itself.

                  I usually get the value of a_field_value.value into a variable, and examine it, and write code to deal with it.

                  So ....
                  If you are entering a new record, all values are in a temporary record buffer in memory.
                  If you are editing a record all previous values are in the record buffer.
                  If you are editing a field, until you write the field (to the record buffer) the value is in a_field_value.value.

                  If I had more time I could post examples of using a_field_value.value, but its pretty simple once you understand where the data is.

                  As for field rules, most will fire only if the record is being entered or edited in a form or browse. Autoincrement and calculated fields are exceptions.

                  So ... when you are writing code in a script, then most field rules will not fire. Supposedly, (although I have not tried it yet,) if you say t.change_begin(.t.) and t.change_end(.t.) the rules will fire in independent scripts.

                  As for field rules disappearing, you most likely have a corrupted dictionary for the table in question. Way back in maybe version 9 we used to have that problem, although I have not heard of if in many years. I would make a new table, append the data to the new table, delete the old table, and then add all the field rules to the new table and rename it to the old table name.
                  Last edited by martinwcole; 08-02-2015, 03:57 PM.
                  Cole Custom Programming - Terrell, Texas
                  972 524 8714
                  martin_w_cole@msn.com

                  ____________________
                  "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                  Comment


                  • #10
                    Re: Field Record Events

                    My field record events all work fine and fully understand the record buffer, my problem is just the disappearing field rules and these are restricted to only disappearing field record events.
                    Looks like a rebuild will be necessary. Is there a way to create a list of all the rules for a table?
                    Thanks

                    Comment


                    • #11
                      Re: Field Record Events

                      my problem is just the disappearing field rules
                      out of curiosity, I tested in version 11 the field level event did not disappear no matter how many times I edited and saved one rule the other one remained the same.
                      if you can reproduce the same and take a screencast and show, that would be helpful.
                      the web and ux, even though red herring may be, confusing others even long time veterans like martin cole.
                      thanks for reading

                      gandhi

                      version 11 3381 - 4096
                      mysql backend
                      http://www.alphawebprogramming.blogspot.com
                      ggandhi344@gmail.com
                      Skype:ggandhi344@gmail.com
                      1 914 924 5171

                      Comment


                      • #12
                        Re: Field Record Events

                        email Finian.lennon@gmail.com. he knows how to get all the field rule events - maybe put in a text file - although he may charge you for his time - would take some time to write a script to save and then auto reapply.

                        are you working with SQL in this? if so how are you using dbf field rules?
                        Cole Custom Programming - Terrell, Texas
                        972 524 8714
                        martin_w_cole@msn.com

                        ____________________
                        "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                        Comment


                        • #13
                          Re: Field Record Events

                          Talked to Finian, and we both agree that if you have a corrupted data dictionary, then you should manually renter all the rules. Otherwise you risk copying the corruption from the old table to the new one. But don't reenter them to the existing table - make a new table and enter them there.
                          Cole Custom Programming - Terrell, Texas
                          972 524 8714
                          martin_w_cole@msn.com

                          ____________________
                          "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                          Comment


                          • #14
                            Re: Field Record Events

                            Duplicating a table will rebuild all of the records and the support files.

                            this usually cleans up problems....

                            Steps.

                            Backup - Backup - Backup

                            Right click table - select Utilities - Duplicate the table to a new name. Select all check boxes.

                            Check the field rules in the new table.

                            Remove the original table and rename new table to the original name.
                            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.

                            Comment


                            • #15
                              Re: Field Record Events

                              In the event Al's method does not work for everything,

                              This is harder!
                              Check NO boxes. all you want is the fields with same names as the old table.
                              Rebuild your indexes, field rules, append the data to the new table, use copy-to for all forms, reports, etc. to get them to the new table.
                              delete old table, rename new table to old table name.

                              If still a problem.
                              create new table and paste the fields from the old table that you copied with drag/click. Then do the rest by hand and append.
                              Dave Mason
                              dave@aldadesktop.com
                              Skype is dave.mason46

                              Comment

                              Working...
                              X