Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Unanswered

Unlinked Attachment already exists error

Posted on by 130

Hi,

I have start implementing business central API, I have successfully implemented '/salesInvoices' and '/salesInvoiceLines' data upload.

However, I have faced issue with attaching document to SalesInvoice in the endpoint '/attachments'.

Whatever document I upload, I am getting the error "The record in table Unlinked Attachment already exists.

 I used following request

https://api.businesscentral.dynamics.com/v2.0/<tenantID>/uat/api/v1.0/companies(companyID)/attachments

Body:

{    “parentId”: “5a086bc7-195f-eb11-89f9-0022481ab2d5”,    “fileName”: “Example.pdf”}

It was advised to retrieve the parent Id from the first successful attachment creation and use that parent Id in the PATCH request instead of creating a new one.

How to do that ? Which request I can use  to retrieve the parent Id from the first successful attachment creation ?

Thanks in advance

  • Dynamics Questions Profile Picture
    Dynamics Questions 130 on at
    RE: Unlinked Attachment already exists error

    Hi DAnny3211 

    There is nothing, just message that shows to ask at the different forum 

    pastedimage1675080036068v1.png

  • DAnny3211 Profile Picture
    DAnny3211 9,272 Super User 2024 Season 1 on at
    RE: Unlinked Attachment already exists error

    hi

    look this

    learn.microsoft.com/.../issue-with-the-api-endpoint-attachments

    DAniele

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans