To generate a new Record from an existing Record each time the Form is Submitted, (instead of the updating the existing Record, which is the default action), add the following few lines of Form Script shown below.
By adding this Form Script your original Record will remain unchanged, and a new Record will be generated from the original Data on the Form.
Open the Script Editor from the “Rules and Script” menu item in the Form Builder, and add the Script as show below.
If you want to optionally create a Field that generates a unique code that you can assemble into your document, add a System Field called “Unique-ID”.
// This will trigger the Script when the Form
// is opened and the existing data has been loaded
// This is a hidden field that contains
// the unique ID for the Record
$('#InfoFileID').val( createGuid() );
// This is the hidden field that contains the unique ID
// for the Form used to view the Data in this instance
This is some additional script that creates a new unique ID number for each Record created by this Form. This is optional and is not part of creating a new Record:
// This creates a new unique ID number for each Record created
// by this Form. This is optional and is not part of creating
// a new Record. May be useful to track Records
var unique-id = 'id-' + Math.random().toString(36).substr(2, 16);