Jump to content
  • 0

Copying Record to same table but with new ID


skcombs

Question

I am working with a legacy ACCESS application where many records are duplicated but with different primary IDs.  These were created in ACCESS with Append Queries.

The straightforward way is to find the record to duplicate, download to EXCEL, change the ID and upload to append to the table.  But I'm trying to automate this task using auto-submit submission forms. The challenge is letting the user modify the ID and create a new record in the same table.  I am not updating the original record, but keeping it.

Any suggestions welcome.  My first approach is to search for the record to duplicate, create an HTML block that passes all parameters by query string to a submission form. This form lets users change the ID and passes on to a submission form that auto-submits.  That does work if there are only a few parameters in the query string.

It fails if the query string exceeds some limit (somewhere over 1,000 characters).  Is there a known limit to query string length?  And, is there a better way to do this?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I have bumped into long query string limits as well. This forum post provides some context: https://stackoverflow.com/questions/812925/what-is-the-maximum-possible-length-of-a-query-string

Another approach would be to use fields to pass the data.

Set the fields to text field or text area so you can pass the data on exit (fig.1). Then set the destination and messaging options to load the new page (fig.2). Lastly, capture the parameters in the submission DataPage with the ID field as a text field for editing (fig.3).

 

fig.1
image.png.301054166d4d24618b0e15510d1b39cc.png

 

fig.2

image.png.c9b9e52f7c4e7841530f04f0e1c3ebeb.png

 

fig.3

image.png.1b113bcd046ae9083c404187d1c3adcc.png

 

If that doesn't work, you can set up cascading fields to load data from the old ID. Set a virtual field to capture the old ID, use this as the parent field, set the lookup table to the table containing the original data, cascade on the old ID, and choose the appropriate field for the cascading value. I would try other options first as this will be a slloww DataPage if your data has many fields.

 

I hope this helps
 

 

Link to comment
Share on other sites

  • 0

Hi @skcombs,

The other option you can do to copy a record is to pass 1 parameter, which is the ID of your previous record. Just like this one:
 

<a href="https://account.caspio.com/dp/AppKey?ID=[@field:ID#]">Copy</a>

Then on your Submission form where it auto submits, you can just receive 1 parameter in a Virtual Field and reference that parameter to other actual fields using Calculated Value. See below:

image.png


image.png

image.png

At the same time, you can hide those Calculated Values so the form will not show anything after auto submit.

image.png

For reference, you can check these links:
https://howto.caspio.com/function-reference/
https://howto.caspio.com/datapages/datapage-components/calculated-values/

Hope it helps!

image.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...