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

Help : I need using DescribeSObjectResult - php example
Hi
I am trying to get picklist values (and modify them ) in the PHP API.
I can only find examples in Java and .NET.
I don't mind converting the examples to PHP , but I get stuck at the point of creating the
object .
The object's class definition is not in the SS include files!
DescribeSObjectResult is only mentioned in the wsdl file .
How does this work? is the object created remotely?
I will really appreciate a PHP sample!
FIXED LINK.
Message Edited by Tran Man on 11-13-2007 09:29 AM
thank you but the link is broken.
please put in the correct link.
This is a small function that I use to create a html picklist for specific field for a salesforce.com object.
$client is a active salesforce.com client, $objectType is the API name for the object (i.e., Account, Contact, etc.) $fieldName is the API name for the field with the picklist (i.e. Picklist__c, etc.), and $selected is the current value of the field (if known).
Hope this helps.
Code:
function describeSObject($sObjectType){
$param = array('sObjectType' => $sObjectType);
$this->result = $this->client->call('describeSObject', array('parameters' => $param), '', '', false, true);
return $this->result['result'];
}
I can post additional code if you want the whole script for login, etc. But that should get you what you want as far as describing an object. It works well - retruns an array with every possible field and subfield. Prevents you from having to login to the client's account, or worse, have them describe their custom fields to you.