0

In my visual webpart, I want to get an item by it's id from a document library, and change it's field value. I don't want to actually read any of its field values, so I was wondering is there is a way to get an item by its id, and use a viewfields caml query to say, get this item without any fields.

Is this possible?

Thanks.

2

You can use the method GetItemByIdSelectedFields,

This method allows you to send as parameters the fields you want to receive

0

I don't think so. You better write a proper CAML query and specify the ID field on the Where clause.

0

What's wrong with the in-built SPList method for fetching the item by it's unique ID?

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist.getitembyid.aspx

If it loads the default SPListItem fields it shouldn't be a concern so long as you are accessing a single item.

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.