function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
unikevinunikevin 

About QueryResult

hi,
I am using get_any() to get the field's value,but I find when the field's value is empty, it will not in the SObject.get_any().

Is there any other way that I can get all the fields' value even though they are empty, so I can get the value like "Sobject.get('FieldName')" ?
SuperfellSuperfell
From the description i'm guessing you're using Axis 1.1 or a tool built on top of axis 1.1. The fact that nulls are missing from the any() array is a bug in Axis (as is the fact that if you query for Id, id is not in the any() either, just in the base sobject).
You either going to have to code around the axis bugs, or switch to a later axis version (but this is not as straightforward as it might be, see http://blog.sforce.com/sforce/2005/06/migrating_from_.html
unikevinunikevin
Sorry, I didn't describe it clearly.
I am using SForce Partner API 6 for JAVA.

eg:
======================================

String query = "select Name,status__c,news_body__c,image_url__c,OwnerId from announcement__c where Id = 'XXXXXX'";

QueryResult qr = null;

qr = client.query(query);
if (qr.getSize() != 0) {
SObject sobj = qr.getRecords()[0];
MessageElement[] ms = sobj.get_any();
for (int c = 0; c < ms.length; c++) {

out.print("


Name:" + c+"."+ms[c].getName());
}

======================================

It only returns 4 items :

Name:0.Name
Name:1.news_body__c
Name:2.image_url__c
Name:3.OwnerId

the Status__c is not in the sobj.get_any(), is there any way to get Status__c , even though it's empty or null?

thanks!

Message Edited by unikevin on 12-29-2005 10:26 PM

SuperfellSuperfell
As i said, you're likely using Axis 1.1, and this is an axis bug.