0

Whenever we add some new record to a Sharepoint list the ID column gets unique number by itself. I want to get that number after adding record. For example, when we add new record in sql server table and if there is some identity column we get its auto generated id column value by @@IDENTITY. I need a similar thing for a Sharepoint list and ID column.

Please provide some reference or code sample. I hope there is some built in feature for doing it as I don't want to query my data after adding to get its id column value. Looking for some efficient way.

2
  • You could store it in a separate one column, one item list that is used for just that purpose, using a SPD workflow that fires on new records being added in the list that you are worried about keeping track of. Just replace what the stored ID is in your 2nd little list with the new one generated when a new list item is created in your target list. Then you can do a lookup on that list item to get the ID for whatever you want it for
    – Jack
    Commented Aug 14, 2012 at 7:33
  • i figured it out. after calling .update() on that perticular item. its ID property updates itself and have updated ID value. Commented Aug 14, 2012 at 7:52

2 Answers 2

1

i figured it out. after calling .update() on that perticular item. its ID property updates itself and have updated ID value

0

you can call item.SystemUpdate()...also this method has 2 parameters setting sone of them to false...will not create new verions and also with not update the id

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.