Forum Discussion
Thanks.
Also, my plan was close to brilliant except it fails if someone deletes the most recent child. If so, then the max Record ID of the table may be 100, but in reality the next record ID created will be 102. I can probably get around this by creating a dummy orphaned child any time someone deletes the most recent record ID, but even though it works, I don't love my solution. Either way, your code is awesome and I will use it in some fashion. Thanks!
------------------------------
Mike Tamoush
------------------------------
- MikeTamoush2 years agoQrew Elite
Yep, that's exactly what I am doing. Except, consider this scenario.
Max Record ID = 100. Thus, when I run the code page, I land on Record ID 101 (100+1). Perfect.
Now this scenario:
Max Record ID =101. User deletes Record 101. Now Max Record ID =100. Thus, next record created will be 102, but the code page will try to navigate to Max Record (100) + 1, or record 101 (which has been deleted).
Two possible solves I see: Make it so the user can't delete the max record. Or, make an action so that if the max record ID is deleted, a 'dummy' orphaned child is created, thus ensuring that the next Record ID created will still be Max + 1.
I went with option 2 and it is working.
The real issue is we keep saying we want the Max ID + 1, but in reality we want the NEXT Record ID created, which USUALLY is the Max ID + 1, but not always. The above action now makes it always that way.
------------------------------
Mike Tamoush
------------------------------