1
0
-1

Dear Expert,

Any way to add a revision number to the record ID when the user edit the record? As my requirement need to keep the version of the record which mean the old record need to keep and create a new record for the modified data.

Best Regards

Tony Chu

    CommentAdd your comment...

    2 answers

    1.  
      3
      2
      1

      Hi Tony,

      I had same requirement and I achieved it by creating two tables. One main table and another revision table with a field 'revisionnumber' in both the tables. At end of every edit/submit by user, copy the record to revision table and increment the revision by 1. You can use 'db update tool' in 'Post Form Submission Processing' to insert/update the revision table. Main table will always have the latest/current record and revision table will have all revisions including current record.

      Hope this helps!

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi, it sounds like you need to have a custom Form Store Binder with some custom logic. You could try to use a custom plugin or some BeanShell, maybe adapt from this article Store Form Field Data to Multiple Tables (v4)

          CommentAdd your comment...