asciisd / zoho-v3

Laravel Zoho API V3 Package
MIT License
16 stars 17 forks source link

Problem with updateZohoable method #17

Closed bfiessinger closed 1 year ago

bfiessinger commented 1 year ago

As the docs say in order to update a record we must first perform a $record->setId('xxxxxxxxxxxxx') on the Zoho Record before adding KeyValues. Using $this->asZohoObject() will only fetch the existing record from Zoho as far as I can see.

Personally I can't perform record updates with the current implementation. The response from $isUpdated is always just an empty array, not an com\zoho\crm\api\record\SuccessResponse Object as it should be.

In order to fix this we must add the following line after https://github.com/asciisd/zoho-v3/blob/c13bfcd2d2288cac7e3052255f3dd8c4983da3af/src/Traits/Zohoable.php#L190

$record->setId($record->getId());
// or 
$record->setId($this->zohoId());

now I get the correct SuccessResponse.