I need to populate a field with a predefined title such as "CHG0001." The "1" being the ID for the item we are about to enter. So I believe I need to pull the ID from the newest item and add one to populate this field.
Anyone have this before?
Solved! Go to Solution.
Hmm, what is the use case that requires this to be populated on the form? Why not just not have this field appear on the "New" form and then you can set the field with workflow, and show the field in "Edit" and "Display" modes?
I have thought about that. It would be easy just to build this field on create, but it's a requirement to have this show as a user is submitting the request.
Create a field name "ToQuery" with default value "X".
Use the following formula in a calculated value:
Max(Lookup("ListName","ToQuery","X","ID",TRUE)) so you will get the max ID in the list.
TRUE is used to return multiple values in an array.
Am not aware of the strongly typed values.
if this is the only reason, then I'd rather try to convince users/project owner that this is not the way how sharepoint works.
creating customized IDs just after an item is submitted is much simpler and straightforward solution.
the method you suggested causes the actual numbers to skip every other one. Because as you stated SharePoint generates the ID so with this method you create one to get the ID to the page, then you delete it. Therefore, you have a number on your page now (i.e.CHG1 ), but the one you are about to create is the next ID number (i.e. ID = 2). So when you create another request the new number generated for the page is the last ID + 1 making the new request number (i.e. CHG3). 1 and 3 are not consecutive.