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

Field Rules - Field Events & Record Events

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

    #31
    Re: Field Rules - Field Events & Record Events

    For any of those who are interested...

    I put together a little application that traces browse events and provides some control & much insight as to how the browse interacts with the underlying table. (I used the methodology that Tom Cone Jr. suggested.)

    There is one caveat, these are table events: If you open the table using the default browse instead of the form/embedded browse (which autoruns), the first (and only the first) record can not be changed as expected. I could have coded this problem out, but I didn't bother. As far as I can tell, the one form with the embedded browse works correctly and shows in real time as it displays the table events as they are firing..........

    Due to a5 limitations, you must enter in some text into the CUSTDESC field. (Alpha will not allow you to save any records that do not have at least one manual entered field.... (Although I might have been able to add a browse based event/trigger to take care of this too.)

    All the events that display can be viewed at the table level, by looking at the field rules....
    (The one function "fnEventsToString()" records the events that are displayed in the right pane, and dings the bell as it displays which events fired, along with a running count.)

    Note: There are also a few other functions and script examples which are partial "hacks."

    BrowseEventTracing.zip
    Last edited by SNusa; 05-15-2012, 11:00 PM.
    Robert T. ~ "I enjoy manipulating data... just not my data."
    It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
    RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

    Comment


      #32
      Re: Field Rules - Field Events & Record Events

      Originally posted by martinwcole View Post
      CANSAVERECORD event - field rules

      if a_deleting_record
      end 'I don't want ANY of the following code to fire if they are deleting record(s)
      end if

      t=table.current()
      n=t.mode_get()
      if n=2 'entering a new record
      msgbox("Note","We just entered and saved a new record")
      elseif n=1 'editing an existing record
      msgbox("Note","We just modified an existing record")
      end if

      Like Gabe said, there may be rules you want applied regardless of what layout you are using, including the default browse
      If you have maybe 10 different layouts for a table that permit enter or edit possibilities, writing code for all of them can be time consuming and error prone
      Wow, in reviewing some notes, I just saw this post. I guess I missed it last May. Thanks for the tip. It ties things together with regards to my testing table field & record events....

      PS: Since that time, I cleaned up that mini events app which shows the table level events triggering in real time. Anyone wants it, I'll resubmit it.
      Robert T. ~ "I enjoy manipulating data... just not my data."
      It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
      RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

      Comment


        #33
        Re: Field Rules - Field Events & Record Events

        Originally posted by SNusa View Post
        Noticed something very strange about the CanEditField Field event....
        This unexpected behavior seems related to adding any/all UI_ functions getting, or presenting visual info to/from the user..... Timing issue here again?
        ..
        Probably more to do with UI box appearance, closing causes a refresh.
        (ie - a form repaint is used to make it "disappear" when closed)

        Comment


          #34
          Re: Field Rules - Field Events & Record Events

          Originally posted by SNusa View Post
          PS: Since that time, I cleaned up that mini events app which shows the table level events triggering in real time. Anyone wants it, I'll resubmit it.
          Robert - it would be interesting to see the workings. I would appreciate it.
          Ray

          Comment


            #35
            Re: Field Rules - Field Events & Record Events

            One other thing to note is that in all CAN events, whether table level or form level, the code for the event will sometimes fire multiple times.
            This can be quite problematic.
            Selwyn, way back in version 4.5 offered the following simple solution:
            in the autoexec define a global variable - Busy, Logical
            then, in the can event code, put the following, at the top:

            Code:
            if busy
                 end 
            end if 
            busy=.t.
            'event code goes here
            busy=.f.
            Cole Custom Programming - Terrell, Texas
            972 524 8714
            [email protected]

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

            Comment


              #36
              Re: Field Rules - Field Events & Record Events

              Originally posted by martinwcole View Post
              One other thing to note is that in all CAN events, whether table level or form level, the code for the event will sometimes fire multiple times.
              This can be quite problematic.
              Selwyn, way back in version 4.5 offered the following simple solution:
              in the autoexec define a global variable - Busy, Logical
              then, in the can event code, put the following, at the top:

              Code:
              if busy
                   end 
              end if 
              busy=.t.
              'event code goes here
              busy=.f.
              Thank you & here is the mini-application. I suspect it will come in very useful for those who want to know what is really going on (all those triggers firing) within an embedded browse..... (I spent the afternoon cleaning up the display so that it's "easy to look" at.) ~ Also added some notes.....

              As for the events triggering multiple times, I'll have to go back and take a deeper look..... It's amazing how much is going on (sometimes) with just one click! Here is the upload.

              One region I did encounter some strange results were with regards to how records are deleted. (The two buttons show this.) Even more strange is how marking records (unmarking too?) "trigger" some very different results depending upon how you mark the records. Using Control-M is very straightforward, but if you right click and do it via the mouse, you get all sorts of unexpected results.

              I know there is some "sloppy coding" in spots. I left it in, in case I wanted to try something else. (And sometimes, I kept "failed experimental code" in place, remarked out. (So that I can go back to it if necessary.) That being said, much of my time on this (today) was getting the presentation to line up in columns.... (As all the data is presented in one huge and "ever growing" string character.) Good or bad, I'd love to get feedback.

              There is some "odd code" I added in there which is not standard by any means. Just for kicks, I added in some code to the tables "OnWrote" event which prompts the user to cancel changes to an existing record. It works fine, but I wouldn't recommend it. I think I began messing with it because I had originally seen some strange results from a logic error that gave me the idea. From that point on, I decided to see what I could do with the code.

              Note:
              Because of the way it was written, any object that makes changes to the Customer Name field will result in the variable vc_String creating an "audit trail" of what triggers are firing from the table. (You'll want to remove the "OnWrote" code near the bottom though if you don't want to get my "home-grown" cancel/undo prompts.) I checked & confirmed that you can simply double click on the table (to open the default browse), make edits, additions etc.... (And then look at the variable vc_String from the IW, once you set the correct IW window session. ~ You'll see what events fired. (Newest ones at the front of the variable.

              PS: With the exception of all browse events being recorded (regardless of field), only the CUSTOMER DESCRIPTION record field is being tracked via the table record/field events. I didn't go the "extra distance" to enumerate everything.... Wouldn't be hard to do though.)
              Attached Files
              Last edited by SNusa; 01-08-2013, 02:23 AM.
              Robert T. ~ "I enjoy manipulating data... just not my data."
              It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
              RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

              Comment

              Working...
              X