+ Start a Discussion


I tried the PHP demonstration of Byrne Reese out. This, so far, only supports querying. I ask myself whether there are already extensions which allow to create, delete, update? Is that still to come? Each ìnfo/advice is welcome.
Byrne ReeseByrne Reese
The bindings for update, delete, etc are actually there since the code was generated from the Salesforce WSDL. All that I implemented was a wrapper class that would automagically manage the session for you. Take a look at the PHP class that extends the SalesforceClient and see what I mean - it should honestly be as simple as cut 'n paste.

Yes it was. The design of the outgoing SOAP messages looks not exactly like the examples in the API documentation ... but it works and I get correct response. Thank you!!!



here is a simple snippet for update (assuming you've logged in)

$client = new SalesforceClient($SESSION);
$FIELDS = array('type'=>'lead','Id'=>'0xxxxxxx00WGuvEAG','FirstName'=>'test');

and for create

$client = new SalesforceClient($SESSION);
$FIELDS = array('type'=>'lead','FirstName'=>'newtest','LastName'=>'test','Company'=>'testthis');

Note that some objects have required fields, so YMMV on what the create array should look like.
I am trying this now with the 5.0 API and I keep getting
FAILURE: common.exception.ApiException: Must send a concrete entity type.
David DollarDavid Dollar
Take note here: in the current (as of 05-09-2005) iteration of the PHP classes, the ordering of the values in the associative array is important. Create will fail if "type" is not the first element.