
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
Any ideas how to make it run?
Thanks a lot!
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.