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

How to Update a Field if a form has been changed

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

    How to Update a Field if a form has been changed

    I would like to update two fields with the date/time a form was changed.

    I have played with the actions scripts, but their doesn't seem to be an event such as "onchange" or "changed". In other words I would like to know if data on the form has changed, and if it has update the field(s).

    Something like;

    Onchange()
    Modifydate.value=date()
    Modifytime.value=time()

    I seem to be stumped with this, any ideas ?

    #2
    RE: How to Update a Field if a form has been chang

    Are you sasying you have 2 fields on a form in which you want to keep track of the date and time a form has changed? Does that mean the form's structure?

    kenn
    TYVM :) kenn

    Knowing what you can achieve will not become reality until you imagine and explore.

    Comment


      #3
      RE: How to Update a Field if a form has been chang

      Yes,

      I am currently using two fields - one for date and one for time and I would like to be able to update BOTH of them with the current system date/time if ANY field has been changed on the form.

      There are approximately 50 fields on the form so I need some sort of "global" event/function that will tell me the form has changed.

      I hope the clarification helps.

      Geoff.

      Comment


        #4
        RE: How to Update a Field if a form has been chang

        Geoff:

        If the change is to the data in a field you can update the two fields when you are saving the record.

        Comment


          #5
          RE: How to Update a Field if a form has been chang

          Yes, the change is to data in the field.

          In other words, the user changes one of the 50 fields on the form, I want to automatically update the "modified date" and "modified time" fields, with out the user having to do anything. As a matter of fact, I will probably protect the fields so the user can never change them, only the system can change them.

          So, the question is How do set up the system to automatically update these fields when a user changes any of the 50 data fields on the form ?

          Comment


            #6
            RE: How to Update a Field if a form has been chang

            Geoff,

            This is what's a bit confusing. We don't know for sure, what it is you want to document. Is it 1) the date and time the form structure is changed or 2) the date and time anytime data has been changed.

            If it's the prior, why is it necessary to know the date and time the structure was changed? If you really need that, how about creating a separate table with appropriate fields and use it as a 'log'.

            If it's the latter, with that many fields, how will you tell which data was changed? If you can't, what's the point to tracking the change?

            kenn
            TYVM :) kenn

            Knowing what you can achieve will not become reality until you imagine and explore.

            Comment


              #7
              RE: How to Update a Field if a form has been chang

              ***As a matter of fact, I will probably protect the fields so the user can never change them, only the system can change them. So, the question is How do set up the system to automatically update these fields when a user changes any of the 50 data fields on the form ?***

              So why are you concerned with a user?

              Or, am I really confused about what you want? OK, no comments from the peanut gallery!

              kenn
              TYVM :) kenn

              Knowing what you can achieve will not become reality until you imagine and explore.

              Comment


                #8
                RE: How to Update a Field if a form has been chang

                Ken;

                It is the later issue. I am not concerned about changes in structure, only changes it data.

                I use 50 fields as an example. The application we are building will be used on laptop computers and we hope to build a synchronization back to a master file. So we want to know which is the most current record.

                So .... now that have I clarified the mudification, if any data field on a form has changed, how to programatically update a field on the same form?

                Comment


                  #9
                  RE: How to Update a Field if a form has been chang

                  Robert answered your question. Code to the onsave event for the form.

                  If a user enters the form, and makes no changes, the onsave does not fire, the date/time doesn't change.

                  If a user enters the form, changes one of the fields, discards changes, the onsave doesn't fire, the date/time doesn't change.

                  If a user enters the form, changes one of the fields, saves changes, the onsave does fire, the date/time does change.
                  There can be only one.

                  Comment


                    #10
                    RE: How to Update a Field if a form has been chang

                    Stan;

                    I originally tried the "onsave" event and that worked ... BUT I found that it also seemed to re-run the "Field Rule" for all field types set to "calculated value".

                    I had a field that was set to a "calculated value", and each time the record was changed it was recalcuating the field. I was hoping to find an event that would bypass this.

                    Geoff.

                    Comment


                      #11
                      RE: How to Update a Field if a form has been chang

                      Never saw that behavior. I can't see why the "save" would cause different effects if the onsave had code attached, but I suppose it could.

                      Of course, if one of the fields involved in the field rule for a calculated field was changed, then the onsave should force a recalculation.
                      There can be only one.

                      Comment


                        #12
                        RE: How to Update a Field if a form has been chang

                        Go to Field Rules:

                        In your Date Field in the first tab check calculated field,
                        Enter Date() in the expression Box

                        In your Time Field in the first tab check calculated field,
                        Enter Time() in the expression Box

                        You may want to check the back of the Xbasic manual (Functions) for variations of time() expressions. I believe Time() has to be a character field.

                        Everytime, a user saves a change, the time and date will be updated - positively w/o fail.
                        Peter
                        AlphaBase Solutions, LLC

                        [email protected]
                        https://www.alphabasesolutions.com


                        Comment


                          #13
                          RE: How to Update a Field if a form has been chang

                          Peter,
                          The reason I'm not nuts about that as a method is that the values will change automatically even if not desired. If you have to do some kind of an update operation to fix another field value on the table at some future time, the calculated field values will automatically change when that may not be deisred. You end up with many or all records with the same date and time changed.
                          I would think that on the AskSaveChange event you could put something like:
                          Datefield.value = date()
                          Timefield.value = time()
                          If you wanted these values on the field as added, you could put the same on the AskSaveEnter or the OnEnter event.
                          John

                          Comment


                            #14
                            RE: How to Update a Field if a form has been chang

                            John,
                            Thanks. That's a good point. You may have saved me from a future disaster.
                            Peter
                            Peter
                            AlphaBase Solutions, LLC

                            [email protected]
                            https://www.alphabasesolutions.com


                            Comment


                              #15
                              RE: How to Update a Field if a form has been chang


                              a calculated filed rule will update even if no data was changed. getting into change mode will do that


                              I would suggest a blob and a check of the blob on save to reset the fields.


                              Dave

                              Comment

                              Working...
                              X