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
phpAgentphpAgent 

how do I pull single field from describeSObject?

Hi evreyone!
I am managing to get the field list using the describeSObject.

$ref2 = $mySforceConnection->describeSObject('contact');
$fields = $ref2->fields;

now if i want a certain field i have to iterate through the whole object like this

foreach ($fields as $key => $value)
    {
        if($value->name == "FieldName")
        {
          code...
            }
        }   
    }

how do get a hash array of all the fields ?
i want  to just do: $fields['FieldName']


tnx
msimondsmsimonds
phpAgent

Try this script and tell me if it works for you!


~Mike