Esempio n. 1
0
        echo $result->success == 1 ? $result->id . " updated<br/>\n" : "Error: " . $result->errors->message . "<br/>\n";
    }
    echo "<br/>Retrieve the updated records again to check the update:";
    echo "<br/><br/>\n";
    $response = $mySforceConnection->retrieve('Id, FirstName, LastName, Phone', 'Contact', $ids);
    foreach ($response as $record) {
        echo $record->Id . ": " . $record->fields->FirstName . " " . $record->fields->LastName . " " . $record->fields->Phone . "<br/>\n";
    }
    echo "<br/>Finally, delete the records:<br/><br/>\n";
    $response = $mySforceConnection->delete($ids);
    foreach ($response as $result) {
        echo $result->success == 1 ? $result->id . " deleted<br/>\n" : "Error: " . $result->errors->message . "<br/>\n";
    }
    echo "</td></tr></table>";
} catch (Exception $e) {
    echo "Exception " . $e->faultstring . "<br/><br/>\n";
    echo "Last Request:<br/><br/>\n";
    echo $mySforceConnection->getLastRequestHeaders();
    echo "<br/><br/>\n";
    echo $mySforceConnection->getLastRequest();
    echo "<br/><br/>\n";
    echo "Last Response:<br/><br/>\n";
    echo $mySforceConnection->getLastResponseHeaders();
    echo "<br/><br/>\n";
    echo $mySforceConnection->getLastResponse();
}
?>
        </tt>
    </body>
</html>