You need to sign in to do that
Don't have an account?
tlaappdev1
PHP toolkit 1.1 queries not returning all COLUMNS from SELECT statement
I figured I would start a new thread since the previous one wasn't really about this issue
http://community.salesforce.com/sforce/board/message?board.id=PerlDevelopment&message.id=2660
The new field Always_Ship_UPS__c shows up in the describeSObject() result. I also successfully updated the field using $sforce->update().
But when I put it in the field list of a SELECT statement, I don't get an error, but it never shows up in my result, whether or not the field has a value in Salesforce. This is the same thing that happened previously when I tried querying a custom formula field.
Any ideas?
as you see no feildname field is listed here this totally sucks
http://community.salesforce.com/sforce/board/message?board.id=PerlDevelopment&message.id=2660
The new field Always_Ship_UPS__c shows up in the describeSObject() result. I also successfully updated the field using $sforce->update().
But when I put it in the field list of a SELECT statement, I don't get an error, but it never shows up in my result, whether or not the field has a value in Salesforce. This is the same thing that happened previously when I tried querying a custom formula field.
Any ideas?
Message Edited by benv on 10-15-2007 04:21 PM
I
have this problem exactly several feilds just can not be selected. I
ahve the most current WSDL they appear as objects with a
describeSObject() but no columns are returning. Hell, I even did a
SELECT Id,fieldname from Account where Id='basdfasd'
and it returned this
Code:
object(stdClass)#7 (4) { ["done"]=> bool(true) ["queryLocator"]=> NULL ["records"]=> array(1) { [0]=> object(stdClass)#12 (1) { ["Id"]=> string(18) "basdfasd" } } ["size"]=> int(1) }
as you see no feildname field is listed here this totally sucks
Message Edited by Tran Man on 10-17-2007 01:11 PM
http://community.salesforce.com/sforce/board/message?board.id=PerlDevelopment&message.id=2649
and other places. I can't imagine anyone actually using this tool in production. Let alone trying to develop with it.
I committted like 4 days to this to find out it is broken... HUH
$mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/enterprise.wsdl.xml');
$mylogin = $mySforceConnection->login(SOAP_CLIENT_UN, SOAP_CLIENT_PW);
$sql='SELECT Id, Order_Date__c FROM Account WHERE Id = '0015000000XZRBVAA5';
$response = $mySforceConnection->query(($sql));
var_dump($response);
nothing to it it just doesn't report that field Order_Date__c and various others
originally i found this problem when I selected all fields from a describe and noticed that many where not in the record set even though they where in the sql statement
Its nothing wrong with the query it works fine in sforce explorer but the API doesn't show all the fields you select on
Message Edited by tlaappdev1 on 10-17-2007 10:50 AM
Message Edited by tlaappdev1 on 10-17-2007 10:53 AM
See if that works
ini_set("soap.wsdl_cache_enabled", "0");
Code:
I have the ini_set("soap.wsdl_cache_enable","0") so that is not the problem and when I do a describeSObject the fieldname im asking for exists but is still not returned from the sql statement. Im totally at a loss here as it works for over 2/3 of the fields.
I have full access to all fields so it is not permissions either. I really think it is a problem with the API as it is happening to other people to with similar code also.
I also tried adding in the queryOption(2000) to the query function but that didn't do anything
Message Edited by tlaappdev1 on 10-17-2007 12:06 PM
Can you open up your enterprise wsdl file and confirm that all your fields are there?
Can you post as much as your code as possible up to the point where it does the query including the ini_set("soap.wsdl_cache_enabled", "0"); statement?
A DE org is a developer edition org.
Here is a cut down version of what I have with the results that I just ran and got the same message
ini_set("soap.wsdl_cache_enabled", "0");
require_once('./SforceBaseClient.php');
require_once('./SforceHeaderOptions.php');
require_once('./SforceEnterpriseClient.php');
$user="user";
$pass="pass";
$wsdl="whereitis";
$mySforceConnection = new SforceEnterpriseClient();
$mySoapClient = $mySforceConnection->createConnection($wsdl);
$mylogin = $mySforceConnection->login($user, $pass);
$sql="SELECT Id, ORG_1st_Order_Date__c FROM Account WHERE Id = '0015000000XXXXXXX'";
$response = $mySforceConnection->query(($sql));
echo "<pre>";
var_dump($response);
// get column names
$stuff=$mySforceConnection->describeSObject("Account");
$fields=get_object_vars($stuff);
foreach ($fields['fields'] as $field){
$keys=array_keys(get_object_vars($field));
$f=get_object_vars($field);
$cols[]=$f['name'];
}
var_dump($cols);
exit;
here is the results of the first trust me it shows up in the describeSObject
Thanks to Trans for figuring it out and he said he would update the API docs to make it aware that even if you select a NULL or nill feild it does not return as part of the object.
Wow what a relief
i am glad that worked for you! Hope your other problems get resolved too!
~Mike