dinsdag 15 november 2011

How to update a Hyperlink column

Today I had a little problem for updating a Hyperlink Column by using the List.asmx web service. 
I wanted to insert a New item with a Hyperlink Column but not only by giving the URL. 
So I searched how to add the description to the Column. 
Quickly found that you can use a comma to indicate the URL in the first part 
and the description in the second part. 

But as you know Sharepoint you must follow certain rules that where not 
descripted in the SharePoint Documentation.

So if you need to do the same, keep in mind next rules...

For updating or inserting a Hyperlink value in a Sharepoint list using the List.asmx web services,
make sure to follow these guidelines:
- Notice that URL needs to include “http://” e.g. http://www.google.com/
- If you want to specify a description, 
  make sure to include a space between the comma (,) and the description.  

So our URL field value needs to have ,,
e.g. http://www.google.com/, Google.

batch example:
<Batch OnError=\”Continue\”> 
 <Method ID=\”1\” Cmd=\”New\”> 
     <Field Name=\”URL\”>http://www.google.com, Google</Field> 

Geen opmerkingen:

Een reactie posten