Update List Item or Set Field in Current Item?


To a large degree, this is like the stupidest question ever.

However, if I Update a field in the current list item, let’s say a date/time field, can I also just Set the same field in the current item? Yes and No.

The operation of Update, which is an instance of the UpdateItemActivity class in SharePoint.WorkflowActions, is obvious enough. On the other-hand, it is not unreasonable to think that Set would behave the same way – except it does not. Set takes effect if and only if the field is not set, i.e. unused at the time the Set executes.

This is fine. Undocumented as far as I can find, but fine nevertheless. When you want a field to be set once, and then become read-only, use Set. Otherwise, if you really want the Update behavior, use that.  It’s that simple, and so simple, it should have been documented!!!

Advertisements

About generation12

I am a SharePoint/.NET consultant in the twin cities.
This entry was posted in Workflow Actions and tagged , . Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

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