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
AKRAKR 

PHP demo - CREATE, DELETE, UPDATE?

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.
AKRAKR

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!!!

 

 

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


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


and for create

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


Note that some objects have required fields, so YMMV on what the create array should look like.
RYakerRYaker
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.