You need to sign in to do that
Don't have an account?

Custom Fields
Hello. I am trying to access Salesforce throught the PHP API, and I am unable to retrieve any data from custom fields. I am using the enterprise wsdl, and a modified version of a code example I found online: [php code:]
function get_accounts($connection, $table, $id, $rows, $column)
{
$query = "SELECT ";
foreach($rows as $row)
$query.=$row;
$query.=" FROM ".$table." WHERE(".$column."='".$id."')";
$queryOptions = new QueryOptions(10);
$response = $connection->query($query, $queryOptions);
// New code starts here
if ($response->size == 1)
{
$accounts = $response->records;
}
else if($response->size != 0)
{
$accounts = $response->records;
// Cycles through additional responses if the number of records
// exceeds the batch size
while (!$response->done)
{
set_time_limit(900);
$response = $connection->queryMore($
$accounts = array_merge($accounts, $response->records);
}
}
return $accounts;
I'm having the exact same problem. Here's what I've got:
I've added 3 "custom" fields to the standard "Case" object. When I request their values over the api (using the __c names), no values are returned.
The REALLY wacky thing is that when I attempt to access those same fields through the Windows program called "Apex Explorer 8.0", I get the values back. I'm using the SAME login in the Apex Explorer as I am with the PHP code.
Can someone please help!
Thank you,
Jon
One other clue to my problem: I *am able* to create() new Case records with values in my custom fields. The problem is that I am unable to retrieve those values.
I dug deep into the PHP class and inspected the lines that actually call the query() method to retrieve data and I see that an array of php standard objects come back and they are missing my custom fields, even though the query string requests them. :(
Any ideas?
Jon
I have the same problem.
So, code retrieves custom field on dev instance while but not in production.
I solved this problem.
I used:
ini_set('soap.wsdl_cache_ttl', '15');
ini_set('soap.wsdl_cache_dir', './wsdl-cache');
...which overrides php.ini SOAP cache setting and my 'local' cached WSDL expiry to 15 seconds.
HTH.