Copy Record A and auto link back to it from Record B ('Copy of Record A')

  • 0
  • 2
  • Question
  • Updated 11 months ago
  • In Progress
I would like to copy a record ("Record A"), and in the new record ("Record B"), I would like to link back to the previous record ("Record A"). This would allow me to see previous versions of Record B.  I don't see how the Copy button will let me take Record A's record ID and put it into Record B's related record field.
Photo of Stanley

Stanley

  • 160 Points 100 badge 2x thumb

Posted 11 months ago

  • 0
  • 2
Photo of Alex Wilkinson

Alex Wilkinson

  • 1,036 Points 1k badge 2x thumb
Two ideas: (1) Try creating a field of type Predecessor, Although originally intended for project management where a task's schedule might depend on completion of multiple predecessor tasks, this field type can also be used in circumstances like yours. (2) Create a "self-relationship" and a custom "copy" button. If your records were in My Table, you would create a new relationship where the master is Record A in My Table and the detail is Record B in My Table. Quick Base will warn you that a "self-relationship" is unusual but it will let you ignore the warning. Then on My Table, create a custom "copy" button that looks something like this:

URLRoot() & "db/" & Dbid() & "?a=API_GenAddRecordForm" &
& "&_fid_X=" & [Record ID#]
Where X is the number of the field that contains the master record id in the self relationship.

So far as I know, you can't use native Quick Base to hide the standard "copy" link, so you would have to make the field X required on your form, for users to enter manually if they used the standard link.
(Edited)