I have seen a lot of questions asking how to get the latest ID in a SharePoint list, but all answers suggest simply querying the last item and using its ID as maximum ID. However, the problem with this method is that if the latest item was deleted from that list then you will not be able to get the correct ID because you will be querying the penultimate item, which does not have the latest ID.
I need to redirect the user from a newifs page to an editifs page after an item is created using SPServices, which needs an ID in the URL. The only solution I was able to come up with is to create a dummy item in that list before creating, get the ID of the dummy item, delete it and then add 2 to it to get the ID I want. This is very hacky but I haven't managed to figure out any other way of doing this. Are there any real solutions to this problem? Thank you.