{"action":"closed","issue":{"url":"https://api.github.com/repos/voycey/cakephp-salesforce/issues/2","repository_url":"https://api.github.com/repos/voycey/cakephp-salesforce","labels_url":"https://api.github.com/repos/voycey/cakephp-salesforce/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/voycey/cakephp-salesforce/issues/2/comments","events_url":"https://api.github.com/repos/voycey/cakephp-salesforce/issues/2/events","html_url":"https://github.com/voycey/cakephp-salesforce/issues/2","id":196105079,"number":2,"title":"Record ID not returned in the result","user":{"login":"amjo","id":441767,"avatar_url":"https://avatars.githubusercontent.com/u/441767?v=3","gravatar_id":"","url":"https://api.github.com/users/amjo","html_url":"https://github.com/amjo","followers_url":"https://api.github.com/users/amjo/followers","following_url":"https://api.github.com/users/amjo/following{/other_user}","gists_url":"https://api.github.com/users/amjo/gists{/gist_id}","starred_url":"https://api.github.com/users/amjo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amjo/subscriptions","organizations_url":"https://api.github.com/users/amjo/orgs","repos_url":"https://api.github.com/users/amjo/repos","events_url":"https://api.github.com/users/amjo/events{/privacy}","received_events_url":"https://api.github.com/users/amjo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-16T16:55:45Z","updated_at":"2017-01-11T01:58:40Z","closed_at":"2017-01-11T01:58:40Z","body":"Hello there,\r\n\r\nfirst off i can't thank you enough for this plugin, it was easy to integrate and pretty straight forward. However, although it's not a bug, but probably something im incapable of doing. \r\n\r\nwe both know Salesforce returns the ID of the record once we create a new record on the SF database, however, i get null. in the logs, i find that this ID is dumped from the file /Plugin/Salesforce/Model/Datasource/SalesforceSource.php line 207.\r\n\r\n```\r\ntry {\r\n                $response = $this->client->create(array($data), $model->name);` \r\n                $this->log(\"before response\");\r\n                $this->log($response);\r\n                $this->log(\"after response\");\r\n            } catch (Exception $e) {\r\n                $response->errorMessages = array($e->faultstring, $this->client->getLastRequest());\r\n                $this->log(\"Error in Create: \". $response->errorMessages);\r\n                return false;\r\n            }\r\n\r\n            return ($response); //This should return the ID of the created record?\r\n```\r\n\r\nThe returned value is in fact the ID of the inserted record, but in my controller when i add a new Contact, the result is a null:\r\n\r\n```\r\n//now, add the user as Contact on Salesforce\r\n\t\t\t$this->loadModel('Salesforce.SalesforceContact');\r\n\t\t\t$this->SalesforceContact->create();\r\n            $crm_data = array(\r\n                \"SalesforceContact\" =>\r\n\t                array(\r\n\t                    'FirstName' => $data['User']['first_name'],\r\n\t                    'LastName' => $data['User']['last_name'],\r\n\t                    'Phone' => $data['User']['phone'],\r\n\t                    'MailingStreet' => $data['User']['address'],\r\n\t                    'MailingCountry' => \"Country\",\r\n\t                    'Email' => $data['User']['email'],\r\n\t                    'LeadSource' => 'website',\r\n\t                    'Stage__c' => 'Lead',\r\n\t                    'TDHC_Webpage_Source__c' => 'contact',\r\n\t                    'Website_Counter__c' => $insert_id,\r\n\t                    'UTM_Campaign__c' => $data['User']['UTM_Campaign__c'],\r\n\t                    'UTM_Content__c' => $data['User']['UTM_Content__c'],\r\n\t                    'UTM_Medium__c' => $data['User']['UTM_Medium__c'],\r\n\t                    'UTM_Source__c' => $data['User']['UTM_Source__c'],\r\n\t                    'UTM_Term__c' => $data['User']['UTM_Term__c'],\r\n\t                )\r\n            );\r\n            $crm_result = $this->SalesforceContact->saveAll($crm_data);\r\n            $this->log($crm_result);\r\n```\r\n\r\nwhat could be wrong? the result in the LOG file is as per the below:\r\n\r\n\r\n```\r\n2016-12-16 18:38:15 Error: before response\r\n2016-12-16 18:38:15 Error: Array\r\n(\r\n    [0] => stdClass Object\r\n        (\r\n            [id] => 0032XXXXXXXXb0qAAA\r\n            [success] => 1\r\n        )\r\n\r\n)\r\n\r\n2016-12-16 18:38:15 Error: after response\r\n2016-12-16 18:38:15 Error: \r\n```\r\n\r\nSee the last line? that's the empty $crm_result, but the previous Datasource file is dumping the correct value.\r\n\r\nthanks,\r\nAmjo"}}
{"actor":{"display_login":"voycey"}}