I've got a list item with a field of type URL. As you know, an URL-field consists of two parts: a description and a URL.
Using javascript to update a field that consists of one part is easy, you just do something like
myItem.set_item('MyTextField', 'MyValue');
myItem.update();
But how do I update a URL-field that way? I've tried the following
var URLObj = { URL: 'http://myurl', Description:'this is a description' };
myItem.set_item('MyURLField', URLObj);
but it fails during set_item,
Also tried this:
var URLField = myItem.get_item('MyURLField');
URLField.set_url('http://myurl');
URLField.set_description('this is a description');
But get_item only returns null.
The URL-field I'm trying to set is initially empty, so that's probobly causing some problems, seems like getting empty fields don't return anything ,just null.
So any ideas on what I could try?