Skip to main content



No record found.

Dynamics 365 Community / Forums / Finance forum / Get URL for document a...
Finance forum

Get URL for document attachment of Released Product

Posted on by 742

Hi Everyone,

On Released Products, we can upload multiple product images. And can keep any one as default one.

This image gets attached in attachment section as shown below,


Now when we click on "Open", the image gets downloaded. When I debugged code, and copied the logic in Runnable class as below, I am able to download the image when that Runnable class excutes.

public static void main(Args _args)
        InventTable inventTable = InventTable::find("1030");
        EcoResProductImage  ecoResProductImage;
        DocuRef defaultDocuRef;

        defaultDocuRef = EcoResProductImage::findDefaultImageDocuRef(inventTable);
        str displayUrl = DocumentManagement::getAttachmentPublicUrl(defaultDocuRef);
        new Browser().navigate(displayUrl, false, false);


When I am printing "displayURL" variable mentioned in above code, I am getting URL in below format,


Also in DocuValue table, AccessInformation field has value as,

My requirement is, I need to share the URL to 3rd party so that they can download the same product image. Can anyone suggest how this can be achieved?

Browser class of D365F&O easily process this URL and I can download the file by using below code, and I could not figure out how it's processing in Browser class.

new Browser().navigate(displayUrl, false, false);

But, how any other software can make use of above URL to download the same image? Is it possible to test the URL using POSTMAN?

  • Suggested answer
    CU23062149-0 Profile Picture
    CU23062149-0 2 on at
    Get URL for document attachment of Released Product
  • vicky1234 Profile Picture
    vicky1234 458 on at
    RE: Get URL for document attachment of Released Product

    Hi Nikolas,

    I have a similar requirement to send the image via logic app and save it to a file share .

    However while doing so its shows me the value of the container i.e. bitmap and what i require is to save a image to a folder.

    How do you change a bitmap/container to image in logic app OR I will need to run a logic to generate the url and save it to the folder in D365

  • Verified answer
    nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: Get URL for document attachment of Released Product

    Another option could be to base64 encode the file and send it as part of the entity (in a Memo field). However there's a maximum size of ~30 000 characters when exporting Memo fields via data entities, so please check whether this is sufficient for you.

  • Rhushikesh R Profile Picture
    Rhushikesh R 742 on at
    RE: Get URL for document attachment of Released Product

    Hi Nikolaos, thank you for prompt response. Actually we are sending the data to Azure data lake using data entities and 3rd party wants the Product image as well.

    So it seems like, the only option is to use different storage location, correct?

  • Verified answer
    nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: Get URL for document attachment of Released Product

    I think these links expire in max 15 minutes (someone was just asking about similar topic this week). Theoretically you can define longer lifespan but then you can't use the standard classes that create those links.

    You might consider uploading the attachment somewhere else such as Azure Files, Sharepoint and Onedrive and share URL for that location to the external app. Or even send the image to the third party directly.

    In other words - I don't think that the document management records/links are intended for direct sharing with external parties.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,835 Super User

Martin Dráb Profile Picture

Martin Dráb 225,526 Super User

nmaenpaa Profile Picture

nmaenpaa 101,148


Featured topics

Product updates

Dynamics 365 release plans