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

Please critique this process!

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

    Please critique this process!

    Hi,

    By copying previous processes, I have accomplished what I want to accomplish, but I doubt I am doing it right or most efficiently.

    I want to place a button on a form to duplicate the last record entered in a browse. (I am entering training information, and the same info needs to be entered for many staff).

    1. I go into the action properties of the browse, click on the tab for variables and define my variables.

    2. I go to the field rules for the table used in the browse table and in the OnWrote event for each of the four fields I want to replicate, I set the variables - defined in step 1. Example: Var->v_date = Formname:browse:field.value

    3. I go back to the form and place a button on the form that opens (gets) table, enters the variables into the fields of a new record (t.date = v_date).

    Seems round-about. I tried the Value Get and Value Set Actions scripts, but couldn't get it to work.

    Is there a better way to do this? I'm betting there is.

    Thanks for the education

    Tom

    #2
    RE: Please critique this process!

    you can repeat the values in the last record by just
    typing ctrl-shift-R when entering new records.

    if you don't want to type it but want to press a button, y
    you can program the button with


    browse1.activate()
    browse1.new_record()
    sys_send_keys("{shift-ctrl-R}")


    assuming that your browse is named "browse1"

    Comment


      #3
      RE: Please critique this process!

      You're Kidding!!!

      I worked all day on my version.

      I'll give it a try, but I don't think it will work because I am changing the parent record, by clicking on the next staff name, then entering the training data in browse2.

      I'll let you know.

      Tom

      Comment


        #4
        RE: Please critique this process!

        Nope.

        I had to try it though. I'll save the script for another occasion.

        Thanks for your comments though - Having Dr. Wayne critique my work - I'll have to put that on my resume.

        I know there is a better, more efficient way of doing this, without leaving the form and ones "fingers never leaving their hands".

        Tom

        Comment


          #5
          RE: Please critique this process!

          It would seem I could eliminate step 1 - defining variable in form under browse2 table under actions/variables since using the Var->name in field rules seems to define and fill the variable all in one operation.

          Tom

          Comment


            #6
            RE: Please critique this process!

            A Dr Wayne variation...
            I have this script in the onkey event for the form

            if a_user.key.value = "{F12}"
            a_user.key.handled = .T.
            sys_send_keys("{CTRL-SHIFT-F}")
            end if

            Pressing F12 copies the FIELD value from the last record...

            Comment


              #7
              RE: Please critique this process!

              I can see where this would work IF one was not working in a set and not changing parent records then wanting to copy the previous record to this new parent.

              Tom

              Comment


                #8
                RE: Please critique this process!

                Tom, Maybe I'm missing something but can't you just use some standard scritping like:

                t=table.open("your_table")
                t.fetch_last()
                x1 = t.field1
                x2 = t.field2
                x3 = t.field3
                x4 = t.field4

                t.enter_begin()
                t.field1 = x1
                t.field2 = x2
                t.field3 = x3
                t.field4 = x4
                t.enter_end(.t.)
                t.close()

                Seems to me that putting this on a button would duplicate only the fields you need from the last record entered in your_table into a fresh record?
                Jeff

                Comment


                  #9
                  RE: Please critique this process!

                  Now this is what I was looking for. Let me "go to school" on it and get back to you.

                  But wait; remember, I want to copy a 4 fields from a child record in a browse, on a form, to a new parent and THEIR child. So If I fetch last fields, it will fetch the last fields from the current parent, not the last fields from the previous parent that I want to copy.

                  But I think there must be way to do it all from the form, and not set variable on the form, then go to field rules, then come back to the form to set a button that ignores the form and enters records directly into the table then refresh the form.

                  What do you think?

                  Tom

                  Comment


                    #10
                    RE: Please critique this process!

                    Tom, To start, the variables in the sample scripting do not have to be set in your formpropertiesvariables. They will be created automatically in the script and then be gone when the script has finished. This is whats nice about scripting like this. Second: By scripting in this manner you can copy and move any data from any fields in any tables to any fields in any other tables in your app. For example if you wanted to use the last sample script I posted but wanted to get your data from a child table instead and then move it to some other table, you could modify it to read:

                    t=table.open("child_table")
                    t.fetch_last()
                    x1 = t.field1
                    x2 = t.field2
                    x3 = t.field3
                    x4 = t.field4
                    t.close()

                    t=table.open("some_other_table")
                    t.enter_begin()
                    t.field1 = x1
                    t.field2 = x2
                    t.field3 = x3
                    t.field4 = x4
                    t.enter_end(.t.)
                    t.close()

                    If one of the tables in the action is the parent table in the form you would use a table pointer of:
                    t=table.current()

                    As for which record you get the data from would depend on how you identify it. If the data you want to copy is in the last entry in the child table you would still fetch_last() after the table pointer is identified. If it is some other record(s) you could query the table in the script and go from there or you could use a fetch_find(). If you would like more help on this you can email me with you table names and fields and I'll help you get the script together.
                    Jeff

                    Comment


                      #11
                      RE: Please critique this process!

                      Tom, This button could be run on the form.
                      Jeff

                      Comment


                        #12
                        RE: Please critique this process!

                        Thank you Jeff,

                        This is what I wanted. I see how it would work and want to study it more. I knew I was working too hard, and not working smart. I don't want to learn "bad habits" and since I admit that I am just learning, I want to learn right.

                        Thanks, and thanks for the offer to get back to you...

                        Tom

                        Comment

                        Working...
                        X