web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to display a local PDF file in a new browser tab?

(0) ShareShare
ReportReport
Posted on by 5

Hello everybody,

comming to you with a short an simple (this was my first thought) question:

Is it possible to display content of a pdf-file, which is located on a server directory, in  a new browser tab by code?

I thought the following code snippet should do the stuff:

System.Uri  uri         = new System.Uri(@'c:\TEMP\TestFile.pdf');
str         fileURL     = uri.AbsoluteUri;

new Browser().navigate(fileURL, true , false);

But when running that code the following error will pop up

pastedimage1610027084686v1.png

Any ideas how to make it run?

Thanks a lot!

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    You clearly have two different requirements:

    1) Open something in a new tab

    2) Open file from local folder

    1 - should work but your browser settings might be blocking it. Try to open some web address such as https://www.google.com and see if it works. If not, the issue is in your browser setup, not D365FO.

    2) D365FO can't see or access your local files (remember it's a website in public internet, with no way to see or access your workstation), so you need to choose another approach to solve your business requirement. If you need to open files from the user's computer, you have to implement a file upload dialog so that the user can send these files to D365FO. You can see how Company logo upload is implemented in Legal entities form.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 449 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 422 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans