web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Export of entity fails

(0) ShareShare
ReportReport
Posted on by 269

Hi to All,

Greetings of the Day!!

Good Evening to All.

When trying to export the entity: BusinessDocuementProjInvoiceRevenuwLineStaging it fails. Complaining of "Violation of PRIMARY KEY constraint.

"BusinessDocuementProjInvoiceRevenuwLineStaging" means it tries to insert the same row twice. This happens both as export to excel and export BYOD. it seems to be a problem when inserting into the Staging Area in D365 before it exports it into excel or BYOD-table.

Please find the snapshot for your complete view.

7181.pastedimage1667823357761v1.png

Could you please let me know what we should do here?

Thanks in Advance for your help.

I have the same question (0)
  • Mahaboob Shariff Profile Picture
    269 on at

    Hi Everyone,

    Greetings of the Day!!

    I have tried exporting the entity ie Business document Project Invoice Revenue line entity and I couldn't able to export it as I got the error (cannot create a record in Business project Invoice lines. transaction ID: 00000, Panelkot. The record already exists.

    Could you please let me know if is it possible to remove the duplicate record from the front end or do we go with technical? or do we have any other solution for this issue?

    Your solutions would be highly appreciated.

    Thanks in Advance.

    Kind Regards,

    Shariff

  • André Arnaud de Calavon Profile Picture
    305,155 Super User 2026 Season 1 on at

    Hi Shariff,

    I moved the question to the Dynamics 365 Finance forum.

    Do you really have the transaction Id 00000 or an actual number? Did you try to use "skip staging" when exporting?

    What exact version of Dynamics 365 F&O are you using? In my test environment (version 10.0.30) there is no primary key on the Transaction ID field, but on a combination of 3 fields: ProjInvoiceId, InvoiceData, NumberSequenceGroupId.

    If you are on an older version, can you check the primary key of the staging table and the entity key on the data entity?

    Do you have customizations on this entity?

  • Mahaboob Shariff Profile Picture
    269 on at

    Hi Andrew,

    Greetings of the Day!!

    Thanks for your valuable reply.

    we have the transaction Id and the error saying that the record already exists.

    we are using the 10.0.28 version of the test environment.

    Could you please tell me how to check the primary key of the staging table and the entity key on the data entity?

    I am not sure about the customizations of this entity(Might be it is customization for this entity)

    Could you please tell me how to remove the duplicate line as per the below error log? It is showing two times but when I download the file and check and it was only one transaction ID is there.

    "cannot create a record in Business Document project Invoice Revenue lines. transaction ID: AB61-001158, Panelkot. The record already exists.

    Thanks in Advance.

    Kind Regards,

    Shariff

  • Mahaboob Shariff Profile Picture
    269 on at

    Hi Andre,

    Greetings of the Day!!

    Yes, I did with using "skip staging" when exporting this entity even though I got the same issue as "cannot create a record in Business document Project Invoice Revenue lines" transaction ID: XXXXXX.

    The record already exists.

    Could you please let me know what steps should I take to remove the duplicate records in this entity?

    Here we have another entity also ie Business Document Project Invoice Employee Line Entity.

    Thanks in Advance.

    Kind Regards,

    Shariff

  • André Arnaud de Calavon Profile Picture
    305,155 Super User 2026 Season 1 on at

    Hi Shariff,

    It could be related to a bug or some sort of data issue. You can ask a developer looking into the details. If there are no customizations involved and you are on a current version, you can also create a ticket for Microsoft Support.

  • AnithaEswaran Profile Picture
    2,032 on at

    Hi Sharif,

    Can you specify only one or two records in the filter, and see if the export fails? 

  • Mahaboob Shariff Profile Picture
    269 on at

    Hi Andre,

    Thanks for your reply.

    Sure, I will check with the developer.

    Kind Regards,

    Shariff

  • Mahaboob Shariff Profile Picture
    269 on at

    Hi Anitha,

    Thanks for your reply.

    I will check and let you know.

    Regards,

    Shariff

  • Mahaboob Shariff Profile Picture
    269 on at

    Hi Anitha,

    I have tried with two records and tried exporting, Now it's working exported with that two records.

    again I tried with two records that already had the records this time I got the same error as above.

    Could you please let me know what we should do here?

    Can you please let me know how to remove those records which are already in this entity?

    I really appreciate any help you can provide.

    Regards,

    Shariff

  • AnithaEswaran Profile Picture
    2,032 on at

    Hi Shariff,

    Can you check the entity key defined in the entity. What is key in staging?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 797

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 610 Super User 2026 Season 1

#3
Subra Profile Picture

Subra 534

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans