+ Start a Discussion
Fraser SteenFraser Steen 

SOQL query not returning case commentbody when comment has carriage returns

I am performing a query that seems to work some of the time and not others.


By intuition and process of elimination it looks like the CommentBody field from CaseComments does not get returned when CommentBody contains any carriage returns or paragraph markers.


The SOQL I am using is:

SELECT Id, ParentId, IsPublished, CommentBody, CreatedById, CreatedDate, SystemModstamp, LastModifiedDate, LastModifiedById, IsDeleted FROM CaseComment WHERE ParentId = '500D000000Dxjfm'


This particular case works well as it has multiple comments some one single line that display fine and others on multiple lines which don't. I have tested this with the simplest output code I could to eliminate any post processing errors.


Has anyone had this problem? can anyone explain it? Anyone know of a workaround or if there is a case submitted for this with the Salesforce dev team.


Under what conditions are you executing the SOQL? AJAX, Apex Explorer, Apex Code (Execute Anonymous, Trigger, Class, Web Service, RemoteAction), .NET, Java, PHP, Perl, Ruby? What API version are you using, and which API (Enterprise, Partner) are you using? If browser-based, what is the name, version, and operating mode (i.e. 32-bit or 64-bit) of the browser? Similarly, what OS are you using, what is its operating mode (32-bit or 64-bit), and if Microsoft Windows, what Service Pack is installed?


I'm going to do some tests just to see if I can get lucky with this, but any information you can provide would be beneficial to coming to some sort of resolution to this.


I wasn't able to reproduce this, can you post some more specifics about how you're executing the soql.

Fraser SteenFraser Steen

 sfdcfox thanks for the response.


I am using the php_toolkit and some custom written php to make the call and recieve the response. I am using PHP 5 and viewing the page using Firefox 4 on a windows 7 64-bit machine, all service packs have been installed. The php server is a Debian 5.0.4 Server running xamp 1.7.3a lamp installation.


The script itself is a basic tool I built to test my SOQL it is literally a form where you can enter text, this text gets directly sent through php_toolkit to salesforce and the resulting object is then displayed in a (reasonably) friendly format.


I appreciate this may very well be a coding issue but it seems odd since so far everything has worked swimmingly. So far everything has worked as expected. Using the cases as an example I have no problem returning case descriptions regardless of content.