API updateEntity problems
Problem reported by Andrew James 12 years ago
Hi
I have been experimenting with the updateEntity method of the API.
It all works but I believe there are some bugs (unless I am doing something that is wrong).
I have carefully searched the documentation.
PROBLEM:
When implementing updateEntity (as per documentation), the following fields are overwritten resulting in data loss without the ability to include these fields in the update call:
Bank Name (bankName)
Account Name (name)
Account Number (accountNumber)
Sort Code (sortcode)
VAT Number
Company Number
PHP file:
Based on the data structure returned from the listEntity method that returns the above information plus bankAccount subarray:
array(1)
{
[0]=> object(stdClass)#3 (23)
{
["supplier"]=> object(stdClass)#4 (3)
{
["default_account_code"]=> int(60)
["default_vat_rate"]=> float(0.2)
["default_credit_terms"]=> int(60) }
["customer"]=> object(stdClass)#5 (3)
{
["default_account_code"]=> int(60)
["default_vat_rate"]=> float(0.2)
["default_credit_terms"]=> int(60) }
["bankAccount"]=> object(stdClass)#6 (4)
{
["bankName"]=> string(4) "klkl"
["name"]=> string(4) "klkl"
["sortcode"]=> string(6) ";l;lkl"
["accountNumber"]=> string(5) "klkl;" }
["id"]=> int(8)
["company_name"]=> string(26) "Omni Customer and Supplier"
["contact_name"]=> string(13) "MrChanged Man"
["address1"]=> string(8) "address1"
["town"]=> string(6) "2 town"
["county"]=> string(7) "2county"
["country"]=> string(0) ""
["postcode"]=> string(10) "2 postcode"
["email"]=> string(17) "email@address.com"
["phone1"]=> string(14) "01234 56789220"
["building"]=> string(8) "building"
["address2"]=> string(8) "address2"
["phone2"]=> string(14) "01234 56789220"
["fax"]=> string(14) "01234 56789220"
["website"]=> string(4) "www."
["date_modified"]=> string(19) "2013-11-08 22:49:05"
["external_id"]=> string(1) "2"
["vat_number"]=> string(0) ""
["company_number"]=> string(0) ""
["statement_url"]=> string(62) "https://secure.clearbooks.co.uk/s/29488:L-tkP4HPCnWaDMtSR9vrww" }
}
I thus tried to implement the corresponding updateEntity but without success.
QUESTION:
How can I updateEntity to also update the fields:
Bank Name (bankName)
Account Name (name)
Account Number (accountNumber)
Sort Code (sortcode)
VAT Number
Company Number
Thanks in advance.
Andy