Hello,
Let me explain, please.
In the attached file is my package with V2 attachment that I send to D365 endpoint "<tenant>/api/connector/enqueue/{recurringJobId}?"
Of course, on D365 side there is appropriate job with three entities: headers, lines and attachments V2.
In that package I send image and file V2 attachments and I see an error in the queue:
Failed to insert record into staging table. The keys of the record are DEFINITIONGROUP, EXECUTIONID, HEADERREFERENCE, PARTITION. Duplicate records must be removed from the file prior to import.
<?xml version="1.0"?><Errors><Error><ErrorCode>-1071636471</ErrorCode><SubComponent>OLE DB Destination [67]</SubComponent><Description>SSIS Error Code DTS_E_OLEDBERROR.
An OLE DB error has occurred. Error code: 0x80004005....
Seems that D365 thinks that my attachments are the same. But why?
Interesting, that if I use old entity VENDORINVOICEDOCUMENTATTACHMENTENTITY with the same package content, except DOCUMENTID field that should be only in V1 attachments - I don't have any errors and both attachments are imported successfully.
May be I should add some additional field in V2 attachment XML?