views:

525

answers:

1

I am using UpdateListItems method (Lists.asmx web service) to update fields of an uploaded document in one SharePoint document library. In my case, I have a document library called Schedules. In it, there's a field called 'Day of the Week' which is a Choice multiple selection, with the allowed values Monday to Sunday. Here's the query that I have found which should select Monday and Friday choices (and it doesn't work, obviously):

<Method ID='1' Cmd='Update'>
    <Field Name='ID'>1</Field>
    <Field Name='Day of the Week'>Monday#;Friday</Field>
</Method>

I have read somewhere that inserting the string "#;" between the choices should resolve this. The end result is that the field Day of the Week is updated with the string "Monday#;Friday" and when I want to edit the item, no selection is being made. On the other hand if I just use "Monday", it works. Now, how can I make it update the multiple selection? Thanks.

+1  A: 

I believe that should be ;#

A quick check shows the way SharePoint stores multi-choice fields, try:

;#Monday;#Friday;#

With the delimiter on the beginning and the end.

And a note: You should also keep in mind that SharePoint stores choices as plain text (not references), so you can place any value there, as you've just witnessed.

Kobi
That is correct. So, in the end it was a typo. OK, is there a way to make the string "Monday;#Friday" appear as "Monday; Friday", i.e. normally, as it would if I made this selection through SharePoint UI? Having the characted '#' in the middle is confusing to the viewer. Help please?
Boris
You're the man! Thanks a bunch.
Boris