While creating Vendor Invoice Register for existing Vendor after saving the line details.
I can see the record gets inserted in the Entity: VendInvoiceRegisterLineEntity.
Then I have added the contact information for the vendor again another record gets inserted in the above entity which is duplicate record of above line details.
Can anybody help to find out how the records are inserting into the entity by suggesting any class or method
I'm afraid that I don't understand. You're saying that if you add contact information of a vendor, it creates a new line in an invoice register journal? It sounds very strange to me.
Also, please realize that no data is stored in data entities. Data entities are merely simplified views of AX tables, e.g. VendInvoiceRegisterLineEntity takes data from LedgerJournalTrans and quite a few other tables. I suspect you're confusing the joined result returned by the data entity with what's actually stored in tables.
It is not creating new line in invoice register but it creates another record in data entity and the record is duplicate of previous one.
and when we are exporting the data form that entity it is giving the below error
"Duplicate error received when exporting VendInvoiceRegisterLineEntity using DMF:
<?xml version="1.0"?><Errors><Error><ErrorCode>-1071636471</ErrorCode><SubComponent>OLE DB Destination </SubComponent><Description>SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005".
As I said, no records are stored in entities. What the entity returns is a result of a query to AX tables. If you don't like the result, you need either different data in tables or (which is likely the case) a different query.
I assume you get some data twice because there are two records in a tabled joined by an inner join.