Monday, August 10, 2009

To Update() or not to Update()...

You can call the Update() method on just about any kind of collection in SharePoint, question is, when do you need to call it?

Simple answer: whenever the object has been directly modified. If you change the metadata on a column, update the column and that's it. If you change the value of a list item, update the list item, and that's it.
Update: you don't need to update a list if you've deleted an item from it or added an item to it, only if it's been changed.

Tricky one now: you add a list to a web then you add a list item to a list and then fill in the field values on that item. Update the list item, then update the list, then update the web.

Ok, it wasn't really that tricky.

No comments:

Post a Comment