Friday, February 24, 2012

Read Sharepoint Lookup field

Sharepoint stores the informations in Lookup fields this way:

ID;#VALUE

Sometimes we need read just the value of id. Someone takes the field value as a string and split the content using Split or IndexOf. This technique is valid but..., if Microsoft changes the way the lookup information are saved ?

To read a lookup field you can use SPFieldLookupValue

Using SPFieldLookupValue we can split the values of the lookup field in a simpler way



Enjoy!

No comments:

Post a Comment