using InsertRecords with ACCOUNTID for contacts works on new contact insert, fails on contact update
Hi,
I'm using the latest version of InsertRecords as follows:
Post data:
'authtoken'=>'REDACTED',
'scope'=>'crmapi',
'newFormat'=>1,
'version'=>4,
'duplicateCheck'=>2
- 'xmlData'=> '<?xml version="1.0"?>
- <Contacts>
- <row no="1">
- <![CDATA[]]>
- <FL val="First Name">
- <![CDATA[D]]>
- </FL>
- <FL val="Last Name">
- <![CDATA[L]]>
- </FL>
- <FL val="Email">
- <![CDATA[dl@email.com]]>
- </FL>
- <FL val="Title">
- <![CDATA[MyTitle]]>
- </FL>
- <FL val="Phone">
- <![CDATA[(999) 999-9999]]>
- </FL>
- <FL val="Is Primary Contact?">
- <![CDATA[Yes]]>
- </FL>
- <FL val="Lead Source">
- <![CDATA[Drupal]]>
- </FL>
- <FL val="ACCOUNTID">
- <![CDATA[1037184000000323228]]>
- </FL>
- </row>
- <row no="2">
- <![CDATA[]]>
- <FL val="First Name">
- <![CDATA[H]]>
- </FL>
- <FL val="Last Name">
- <![CDATA[S]]>
- </FL>
- <FL val="Email">
- <![CDATA[hs@email.com]]>
- </FL>
- <FL val="Title">
- <![CDATA[MyTitle]]>
- </FL>
- <FL val="Phone">
- <![CDATA[(999) 999-9999]]>
- </FL>
- <FL val="Is Primary Contact?">
- <![CDATA[Yes]]>
- </FL>
- <FL val="Lead Source">
- <![CDATA[Drupal]]>
- </FL>
- <FL val="ACCOUNTID">
- <![CDATA[1037184000000323252]]>
- </FL>
- </row>
- </Contacts>'
What I have noticed is that when the contact does not already exist, the record inserts with no problem and I get a return code with success for the above. But when I rerun the above (to simulate an update), and the contact already exists, I get the following errors:
- <?xml version="1.0"?>
- <response uri="/crm/private/xml/Contacts/insertRecords">
- <result>
- <row no="1">
- <error>
- <code>401.2</code>
- <details>You do not have the permission to edit this record or the "id" value you have given is invalid.</details>
- </error>
- </row>
- <row no="2">
- <error>
- <code>401.2</code>
- <details>You do not have the permission to edit this record or the "id" value you have given is invalid.</details>
- </error>
- </row>
- </result>
- </response>
From what I understand, using version=4 with duplicateCheck=2 should update these records, not return an error code. I have confirmed the accountid's I am using are correct, and I was the creator and owner of all of these records.
Am I passing in the associated account wrong? Or is there an API bug?