Prevent editing previous years' entries
We have database, with one entry per member in the "Contacts" table for members, and one entry per member, per year, in the "Memberships" table (i.e. each Contacts entry is associated with multiple Memberships entries from various years). One of our layouts uses the Contacts table to display a member's contact information, and in a portal shows the related Memberships entries for that member for the years they were a member (the Memberships table includes the member's ID, the year for that membership, and various other fields like date paid, etc.).
Unfortunately, one of my users tried to be clever and manually bulk-update some information for people who paid on the same day, and because this was done in the Contacts layout instead of the Memberships layout, the user overwrote a selection of members' entries from all years (instead of updating just the current year) with the command-equals "replace" command. The data is recoverable, but a pain in the butt, especially if not caught quickly.
I'd like to find a way to prevent this from happening again. I've already made the Memberships fields non-editable in Browse mode on the Contacts view, but I'd like to prevent editing previous years' entries altogether.
I am considering adding a validation calculation to each of the desired fields in the Membership table with something like the following?
If ( Membership::Year < Year ( Get ( CurrentDate ) )
1. Is this the best way to do what I'm trying to do, or am I missing some unintended consequences?
2. Would this work in preventing bulk replacement of values? (If not, is there any way to?)
(For the sake of argument I'm presenting a situation where as of January 1, 2015 you can no longer edit memberships for 2014 or earlier.)
Thanks in advance,