Not Getting Response text at all

Nov 10, 2010 at 5:27 PM

Hi Marc,

First of all I'ld like to thank you for a very cool library, its been very useful.

I am using it with SharePoint 2010 with good results and for the most part its been fairly painless.

 

I have some code that is not returning any response text, its wierd.

this is waht I have.

function UpdateSharePoint(id, title, bulletin)
{
	
	alert('made it to UpdateSharePoint');
	if(id==0)
	{
		alert('id was zero');
	}
	else
	{
		alert(id + "\n" + title + "\n" + bulletin);
		//		batchCmd: 'Update',
	$().SPServices({
		operation: 'UpdateListItems',
		webURL: 'http://ludwig',
		async: false,
		batchCmd: 'Update',
		listName: 'Bulletins',
		ID: id ,
		valuepairs: [['Title', title], ['Body', bulletin]],
		debug: true,
		completefunc: function(xData, Status) {
		alert(xData.responseText);
		alert(xData.responseXML.xml);
			if(Status != 'success'){
			alert('There was a problem updating the Sharepoint Server' + Status);}
		}
	});
	}

}

 

Now I CAN Get it to send a response back by changing WebURL to WebUrl and the status IS error currently so that is coming back ok.

Not haveing the response text or xml to look at is making this troubleshooting session pretty tough...hoping some one out there can shed some light or point me in the right direction.

 

Thanks

David Moody

Nov 10, 2010 at 7:32 PM

Ok I think I got this,

I was trying to put HTML in the Body of an announcement. I THINK that was causeing a problem. Why it would cause NO response I don't know so it looks like that I will need to strip all of the HTML out before I update the items.

 

Thanks :-)

Coordinator
Nov 10, 2010 at 8:21 PM

When you get stuck like this, try stripping things back as far as possible. Update only the Title, hard-wire the ID, etc. untill you get a working version, then take baby steps forward again.

I don't *think* that the HMTL for the Body should have been a problem unless you are disallowing it in the list settings.

M.

 

Nov 10, 2010 at 8:40 PM

I really need to able to update with html. I don't see a setting that would disallow it though.

Coordinator
Nov 10, 2010 at 8:46 PM

BTW, the option is webURL and capitalization matters. I just noticed that I have some mistakes in the docs on this and I'm going to fix them right now!

M.

Nov 11, 2010 at 1:41 PM

So it turns out that whaen your updating EnhancedHTML fields in sharepoint 2010, with html, using webservices you have to encode the HTML first. I found some javascript already written here http://www.strictly-software.com/htmlencode 

Once the html is encoded it works a treat :-)

 

Thanks

 

Coordinator
Nov 12, 2010 at 2:02 AM

Good catch.

M.