Accessing field data from ListItems

This guy has almost all the information you need.

Basically

i)   Check that the field exists
ii)  Check that the field value is not null
iii)  Happily use the value contained in the ListItem to your hearts content.

The linked article used the ‘ListItem.ContainsField’ to avoid some nasty exceptions that can crop up with missing fields.

Check for null values is my lame little value add that tripped me up and I thought it might help remind me (and others) to write it down here.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: