Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Get D365 Document Atta...
Finance forum
Suggested answer

Get D365 Document Attachment from external application

Posted on by 47
The client has a third-party app that needs to contact the d365 F&O document management blob storage and retrieve/download a file. I haven't found online if there is a way for external code to retrieve the document management files. I am able to load DocuRef and DocuValue fields and linked record info to their database, but has anyone downloaded document management blob files from external code through API or other? What fields should I pass them in my integration so that they can reach the Document management code.
 
Alternatively, will we need to set up a middle application such as an additional Azure blob storage account. Let me know how you would handle this, I am open to all ideas that optimize for simplicity.
 
Thanks!
  • CU07051604-0 Profile Picture
    CU07051604-0 47 on at
    Get D365 Document Attachment from external application
    Thanks Martin. Thinking about it now, do you think it would be better to write X++ code to create/retrieve the binary data string or base 64 string for these attachments, and then send this to a new field in the clients Azure SQL database, along with the other fields I am already sending, so that it would be available there (directly in the database) for the external application code to call quickly and download the file rather than contact the D365 custom service?
     
    I'm not sure if this is even possible or recommended from a storage perspective but let me know your thoughts.
     
     
    Thanks
  • Martin Dráb Profile Picture
    Martin Dráb 224,528 Super User on at
    Get D365 Document Attachment from external application
    Encoding data with Base64 and then decoding back is obviously more work than not doing anything at all.
    Also, the Base64 string is larger then the original data, therefore it takes longer to transfer.
  • CU07051604-0 Profile Picture
    CU07051604-0 47 on at
    Get D365 Document Attachment from external application
    Thanks Martin, that answers my question. Just curious, why/how is binary form more efficient? 
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 224,528 Super User on at
    Get D365 Document Attachment from external application
    Likely the easiest solution would be calling a standard custom service: DocumentHandlingService.getFile(). You give it a DocuRef RecId and you get an object with the file content encoding with Base64. It's less efficient than getting the file in the binary form but you don't have to develop and maintain any custom solution.

Helpful resources

Quick Links

Can you answer this forum question?

You could make someone's day!

Community Newsletter - May 2024

Kudos to our community stars!

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 283,632 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 224,528 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Featured topics

Product updates

Dynamics 365 release plans