Notifications
Announcements
No record found.
Hello
I would like to send the image (or) url of the image which we generally attach to records attachment in D365F&O (DocuRef, DocuValue tables) to the 3rd party system
I did try using ==> DocuAction d = attachedDocuRef.docuAction(); and d.getPublicUrl(docuRef), but that image file never be found... ?
any solution please?
Hi RahulD365,
Do you mean that you get URL, but if you try to open, you can't access the file?
yes
Please check the getAttachmentPublicUrl method in the DocumentManagement class:
str displayUrl = DocumentManagement::getAttachmentPublicUrl(docuRef); Browser br = new Browser(); br.navigate(displayUrl);
Hi,
We have custom service to send the attachment data code is like below, you can use the same code:
data is the custom object where all the values are set and returned to service, you will need to update the code as per your requirements.
if (docuRef.isValueAttached()) { DocuValue docuValue = docuRef.docuValue(); URL url = DocumentManagement::getAttachmentPublicUrl(docuRef); if (docuValue.Type == DocuValueType::Others) { //For sharepoint files -> we get convert internal system.net.connectStream to memoryStream and return byte if(docuValue.StorageProviderId == DocuStorageProviderType::SharePoint) { using (System.IO.Stream connectStream = DocumentManagement::getAttachmentStream(docuRef)) { using (var ms = new System.IO.MemoryStream()) { connectStream.CopyTo(ms); byteArray = new System.Byte[ms.Length](); ms.Read(byteArray,0,ms.Length); } } data.parmByte(byteArray); } //For azure blob else { using (System.IO.Stream fileStream = DocumentManagement::getAttachmentStream(docuRef)) { byteArray = new System.Byte[fileStream.Length](); fileStream.Read(byteArray, 0, fileStream.Length); } data.parmByte(byteArray); } } } data.parmPublicURL(url); data.parmStorageProvider(enum2Str(docuValue.StorageProviderId)); data.parmAccessInformation( docuValue.AccessInformation); data.parmFilename(docuRef.filename()); data.parmfiletype(docuRef.fileType()); data.parmTypeId(docuRef.docuType().TypeId);
Thanks Vinit, and do you have code to create the attachment from 3rd party? Like how to read the image from 3rd party? using container ?
Thanks Will, but I see my downloaded str is something like this - filemanagement/834er32c-1497-4114-86c6-6221762b76b6?access_token=eyJDb21wYW55IjoiVVNTSSfffkhhc2hlZFRva2VuIjo................
but I cant browse this/or find the image associated? Can i get absolute url?
Please check the getPreviewUrl() method in the class docuManagement.
docuURLprev = docuManagement.getPreviewUrl(docuRef);
Why you have to preview the image. You shouldn't focus on the urls , just work with them.
Anyone knows - how to import the image data from 3rd party to D365 F&O ?
As said, I'm going to store the image in docuRef, but let's say using FormPart (postman) I upload the image and this needs to be attached to D365 Docuref record?
Any idea?
Will, 3rd party need to have the URL so that they can download, I managed for the full URL but its not that concrete.
Can Anyone help?
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 646 Most Valuable Professional
André Arnaud de Cal... 529 Super User 2025 Season 2
Sohaib Cheema 285 User Group Leader