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 do I duplicate a record

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

    how do I duplicate a record

    Hello everyone,

    Using App server 8

    I have a flat file table and I want to let the user duplicate a record but I don't see how or where this is done. Maybe I need to add a button to the web page with some XBasic code to accomplish this?

    Any pointer appreciated.

    Thanks

    -John

    #2
    Re: how do I duplicate a record

    There may be better ways, but you could lookup the fields from the record you want based on a variable, then enter those values into a new record. Here is an example for one field, the code would go in the AferValidate section of a dialog:

    Code:
    tempnote = lookup("[PathAlias.adb_path]\workorders", "workordernum="+session.workorder,"notes")
    
    t = table.open("[PathAlias.ADB_Path]\workorders")
    	t.enter_begin()
    	t.notes = tempnote
    	t.enter_end(.t.)
    t.close()

    Comment


      #3
      Re: how do I duplicate a record

      Hello John,

      Welcome!

      This is one of my duplicate methods. On this particular grid, I use the lookup method (see pics). I allow my users to "Duplicate previously posted jobs" then make minor changes to customize it. This fills all the necessary fields except the drop down fields on the grid.

      OR fill fields from their previously submitted sites. This also fills several fields in this grid.

      I first create calculated fields (see Dup2). Duplicate2 = "Duplicate previously posted jobs!" and Sites2 = " Fill fields from your submitted sites"

      Then place these calc fields in the "Selected" column. Then choose "lookup" (see Dup3) and field map the fields.

      I use this method on several grids.

      Hope this helps!
      Last edited by EricN; 05-06-2008, 12:16 AM.
      Eric

      Alpha Five Websites
      longlivepuppies.com
      socialservicenetwork.com
      -------------------------------------------------
      socialservicenetwork.org

      Comment


        #4
        Re: how do I duplicate a record

        John - you might also check the help docs for <tbl>.record_clone() and see if that fits your needs.
        -Steve
        sigpic

        Comment


          #5
          Re: how do I duplicate a record

          Hi and thanks for all the replies. I've been out of town so I haven't had time to check these out. I'm going to start doing that today and will let you know.

          Thanks again

          -John

          Comment


            #6
            Re: how do I duplicate a record

            Here is a method without code.

            In design mode for a form,
            Bring down the Task List
            Click on "Pre-Defined" Buttons Tab
            Scroll down to "Records"
            Click the "+" to open all entries for "Records"
            Select "Duplicate Record" by clicking on it
            Save

            Now all a user has to do is highlight (select) a record from a browse, etc., and press the "Duplicate Record" button and it's done. He/She then can change any data in the duplicate record and save it.

            Comment


              #7
              Re: how do I duplicate a record

              Originally posted by Rudy16 View Post
              Here is a method without code.

              In design mode for a form,
              Bring down the Task List
              Click on "Pre-Defined" Buttons Tab
              Scroll down to "Records"
              Click the "+" to open all entries for "Records"
              Select "Duplicate Record" by clicking on it
              Save

              Now all a user has to do is highlight (select) a record from a browse, etc., and press the "Duplicate Record" button and it's done. He/She then can change any data in the duplicate record and save it.
              Unfortunately this is the WAS section - what you posted refers to DESKTOP forms. However I can imagine some of the code would be similar.... just not the same!

              Comment


                #8
                Re: how do I duplicate a record

                Originally posted by EricN View Post
                Hello John,

                Welcome!

                This is one of my duplicate methods. On this particular grid, I use the lookup method (see pics). I allow my users to "Duplicate previously posted jobs" then make minor changes to customize it. This fills all the necessary fields except the drop down fields on the grid.

                OR fill fields from their previously submitted sites. This also fills several fields in this grid.

                I first create calculated fields (see Dup2). Duplicate2 = "Duplicate previously posted jobs!" and Sites2 = " Fill fields from your submitted sites"

                Then place these calc fields in the "Selected" column. Then choose "lookup" (see Dup3) and field map the fields.

                I use this method on several grids.

                Hope this helps!
                EricN... I don't know if your still posting on this board but I wanted to thank you for this solution. It has given helped me specifically solve this problem with duplicating based on previous records. Fantastic!

                Chuck

                Comment


                  #9
                  Re: how do I duplicate a record

                  Hello Chuck,
                  I'm still here! Thank you for the compliment, however that post was a while ago and I have since improved how I do this.

                  My employers post jobs similar to ones they have already posted so I have a screen (pic 1) displaying jobs they have in the system. The user clicks the job to be duplicated. Inside the (pic 1) page, I have this code (pic 2). I set the session.vPostnum by whatever the chosen job's postnum is. This session.vPostnum is then used in a dialog to fill the dialog's fields. See the initialize event in (pic 3).

                  Once the user has made the changes for this job and clicks the dialog's submit button, the aftervalidate contains:

                  dim tbl as P
                  tbl=table.open("[pathalias.adb_path]\posts")
                  tbl.enter_begin(.T.)

                  ........... fields to enter ........

                  tbl.enter_end(.T.)
                  tbl.close()

                  and creates the new job.
                  Last edited by EricN; 10-12-2009, 03:27 PM.
                  Eric

                  Alpha Five Websites
                  longlivepuppies.com
                  socialservicenetwork.com
                  -------------------------------------------------
                  socialservicenetwork.org

                  Comment


                    #10
                    Re: how do I duplicate a record

                    In my case the user has to enter patient data. The database contains some 5000 patients currently and some are now repeating assessments. I am using your method to allow the user to look up the patient and once found auto fill the demographics and other things that don't typically change over time. Saves some time according to the user (although I think the search eats that up) more important to me is that it limits mistakes and keeps name spellings consistant. Your new method looks interesting if a bit more code rich. Is there some limitation of the old method that I should be aware of? Seems to work very well so far.

                    Thanks again.

                    Comment


                      #11
                      Re: how do I duplicate a record

                      No. The first method (post #3) worked fine. I just didn't like how it looked and what I use now seems to meet my needs better.
                      Eric

                      Alpha Five Websites
                      longlivepuppies.com
                      socialservicenetwork.com
                      -------------------------------------------------
                      socialservicenetwork.org

                      Comment


                        #12
                        Re: how do I duplicate a record

                        concerning duplicating records. Does anyone know how to duplicate the form and the grid at the same time. I have been able to duplicate the record form, but it does not duplicate the items in the grid. I have companies that send in say 50 orders, each one with a different purchase order but the same items. The orders are this way because of shipping to different locations and times. If i can duplicate the whole record i could just change the order number and shipping point.

                        thanks

                        Earl

                        Comment

                        Working...
                        X