No announcement yet.

Copy/Duplicate button

  • Filter
  • Time
  • Show
Clear All
new posts

  • Copy/Duplicate button

    Dear all,

    I need to insert a duplicate record button on a form o in a editable grid.
    Does anybody has did it before and is there a complete sample with also php code ?
    How can edit it just created and let user to modify some fields ?
    I'm not a programmer and I don't know what to write into php code section.
    Many thanks

  • #2
    Re: Copy/Duplicate button

    I am not sure I am interpreting your issue correctly so I think you are looking at this incorrectly but could be wrong.

    A grid is usually used to report or access existing records on a database.
    A form is used to maintain (add, delete, change) records on a database.

    What you might want to do is:
    1) Create a form for table x.
    2) Create a grid for the same table x.
    3) Link the grid to the form using the menu on the left side of the grid application called "Link". You should use the primary key as the linking field to get to the form.
    4) Execute your form, it should display all the existing records on the database.
    5) Select a record to maintain (change, delete), this will access the form.
    6) If no records exist, you can set the "Link" to display the "New" button when no records exist so that you can get to the form and insert a new record.
    Hope this is correct if not, my apologies.


    • #3
      Re: Copy/Duplicate button

      Thanks Javier,

      my needing is a little bit different.
      Immagine that you have to insert 50 records with more or less the same data except for istance serial number different.
      User would like to copy all data from previous record or selected one and then with replicated record available go to edit it and modify only one field content (i.e. serial number).
      I need to do that. For istance PHPRunner has it as default icon on each displayed row with the copy icon.
      I hope to be more clear


      • #4
        Re: Copy/Duplicate button

        In the grid you can create a button to do that.

        Create a run button called (Duplicate for example) ... to do waht you want.
        Search for "Run Button in a Grid Application (Processing Records)"

        Or on the form you can do this onAfterInsert

        After insert you can simple execute:



        • #5
          Copy button on form


          Trying to do what you suggest above but can't get it to work as a form button?

          Need a form button that duplicates the current displayed record so the user only has to change a couple of fields instead of retyping everything.

          Can someone show what the button code would look like?

          Thanks for any help!


          • #6
            Hallo Instore,

            Did you try from the toolbar in the form_settings the button "copy". It should come together with the "update" button.
            Watch also "return after inserting" = "yes" in "application/navigation".
            Hope this helps.


            • #7