As per the title above, I have a list that stores IT support requests. I need a sequence number that matches with the item ID and I want to add this sequence number to the Title of the request.

I know that we can add an item added event receiver and get it done. Since I am already adding the request item via a Visual webpart thought it might be nice to have all the functionalities under one shell.

Any suggestions?

  • The OOTB column ID on list items is not enough I guess? Apr 17 '13 at 13:33
  • @RobertLindgren Nope! I want the users to have a service request ID... thats a lil meaningful!
    – Muhammedh
    May 19 '13 at 9:26

First add the List Item so its Id is generated, than get the item again... Update its Title field and concat Id column with it.. Pseudo-code below:

ListItem newItem = lstObject.Items.Add();
newItem["Field"] = "something";


newItem = lstObject.Items.GetItemById(newItem.Id);
newItem["Title"] = "YourText" + newItem.Id.ToString();

If you don't want the other update to create version than you can use UpdateOverwriteVersion() instead of Update() function!

  • or SystemUpdate() method.
    – Muhammedh
    Jun 2 '13 at 13:03
  • Small catch to this solution is if you have set up an alert on this list for send when new items are added you will not see the new title in the email. Just a friendly note :)!
    – Muhammedh
    Feb 25 '14 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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