Jump to content
The ORIGINAL FileMaker Community - Forum - Online Business Apps & Software Forum
Harry Saddler

Versioning records

Recommended Posts

Harry Saddler

Looking for some expertise here:

I want to be able to version individual records and keep the prior versions around for reference. For example:

  • Let's say I have a table with fields "id" and "version".
  • And I have a 'details' layout that shows a single record from that table.
  • One of the records using that table has id "AB-001" and version "0".
  • I (programmatically) make a copy of the record, and increment its version to "1"
  • Now, in the 'details' layout, I want to show a 'versions' list, showing all records whose id is the same as the displayed record.
  • So in this case, on the details layout for record "AB-001 version 0", the versions list would show "AB-001 version 0" and "AB-001 version 1".

I was trying to do this with a portal, but FM doesn't allow portals showing records from the current table. The only other solution that comes to mind here is to duplicate the record into a separate table, whose fields are the same as the original table.

Any other ideas?

Share this post


Link to post
Share on other sites
Steve Martino

 A self join relationship would probably do the trick, or id, version and details should be in a related record.  Contact Table, related to Version table.

If the most recent related record is always the most recently created record, then sorting the relationship by a creation timestamp, descending in a one row self-join portal would always show the most recent.

 

Share this post


Link to post
Share on other sites
Harry Saddler

That worked. I didn't know about self-joins, thanks for the tip!

Share this post


Link to post
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.

Guest
Reply to this topic...

×   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.




×
×
  • Create New...

Important Information

Terms of Use