I’ve used this method in a few apps now. The only gotcha is that it is subject to a race condition if two or more users happen to be creating a new record at the same time. So definitely not recommended for high volume usage. But if records are added infrequently, then it works fine.