I am trying to create a new Contact object on Salesforce when our customer inputs their info in WordPress form.
What I notice is I am able to create Lead, Account, etc, but not Contact Object in particular.
The AccountId and LastName fields are the only required field in the Organization's Contact. By the fact that I'm able to create Lead and Account, I'm assuming connection parts are working fine.
$contact = new stdClass();
$contact->type = "Contact";
$contact->fields = array(
"AccountId" => '0016F00002OcBIMQA3',
"RecordTypeId" => '0126F000001hG2WQAU',
"LastName" => "test",
);
try {
$result = $sforce_connection->create(array($contact));
var_dump($result);
} catch (Exception $e) {
var_dump($e);
}
There are no error messages coming up. There's no error, except, new contact is not created.