Skip to main content

Notifications

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

ParentID for attachments

Posted on by 57

I am trying to get attachment from business central through postman but it keeps asking me for a parentID, how do I get this parentID?

  • Verified answer
    Gianfranco C. Profile Picture
    Gianfranco C. 370 on at
    RE: ParentID for attachments

    in the v22 release of Business Central it is possible to obtain the attachment of table 1173 with this call:

    api.businesscentral.dynamics.com/.../salesInvoices

    pastedimage1678285124081v2.png


    up to release v21 you can only have expand=attachments (table 130)


    if you want to get all attachments in table 1173 , you can use the call:

    pastedimage1678285164308v3.png

    if it helped you, please select this answer, thank you

  • se23 Profile Picture
    se23 57 on at
    RE: ParentID for attachments

    is it possible to get documents attached to a posted sales invoice? im trying to get reports attached through table 1173

  • Gianfranco C. Profile Picture
    Gianfranco C. 370 on at
    RE: ParentID for attachments

    are you sure the attachment is in the right section? this API reads table 130, not 1173.
    Check which section your document has the attachment in.

    pastedimage1678263297808v1.png

    If it is not in the indicated section, you can upload it via the appropriate action:

  • se23 Profile Picture
    se23 57 on at
    RE: ParentID for attachments

    after i added the parentId and the parentType, no values are showing in the "value" section, it's just empty

  • Gianfranco C. Profile Picture
    Gianfranco C. 370 on at
    RE: ParentID for attachments

    Hello the correct syntax for retrieving attachments is as follows:

    https://api.businesscentral.dynamics.com/v2.0/TenantID/environmentName/api/v2.0/companies(companyId)/attachments?$filter=parentId eq SYSTEMID and parentType eq 'RECORDTYPE'

    pastedimage1678224979377v1.png

    RECORDTYPE can take these values:

    " "

    Journal

    Sales Order

    Sales Quote

    Sales Credit Memo

    Sales Invoice,

    Purchase Invoice

    Purchase Order

    SYSTEMID is relative to the record that has attachments (e.g. the systemid of a Sales Invoice, a Journal)....

    pastedimage1678225049613v2.png



    if it helped you, please select this answer, thank you

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans