0
votes

I have a simple calculated column in my SharePoint 2010 list. It takes the list item ID, adds 100 to it.

When my users are creating items in the list, the calculated column does not get updated unless I go in, edit the column (do nothing) and save it. It, in fact, gives all items a value of 101 unless I manually edit the column.

Is this typical or is there a work around for this issue?

Thank you!

3

3 Answers

1
votes

It is not possible to create calculated column based on ID value. The Id of the item is created after the item is added to the list.

You should use workflow instead.

1
votes

The problem with using a workflow to do this (as per the accepted answer) is that workflow can take an appreciable time to execute. So you cannot create the ID until AFTER the new item is saved and there is always the danger that simultaneous users can create ID clashes that you also have to handle. If the workflow (as on a busy system) takes several minutes to work, you can also get the problem of someone else editing the item before the workflow has finished which may cause the workflow to fail leaving the item without any ID.

As an alternative, you might consider using JavaScript in the NewItem.aspx page to lookup and increment a counter from a separate list. Note that you have to update the counter as you read it if you are doing this so as to ensure that other users don't accidentally get the same ID if creating entries at the same time. This means that you must not mind the counter incrementing even if a user subsequently cancels the new item without saving.

0
votes

As you noticed in opening/saving an item, The Calculated Column is updated on every item change. Does it work to have a Workflow read the Title and write (the same) Title? The [ID] reference in the Calculated Column should be set. No need for an extra LookupID column then.