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

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

How to add custom action button (only using AL) to preview PDF?

(2) ShareShare
ReportReport
Posted on by 1,025

Hi Experts,

Is there a way to preview a PDF file directly from an action button in Business Central?

I’ve already reviewed the following blogs, they are too good, but they doesn't match my exact requirements:

Has anyone implemented a pure AL solution for previewing documents (for example, opening the file in preview mode directly from an action button or immediately after uploading it), without relying on the standard Incoming Document pages?

Or to attach PDF preview mode in the factbox just as they did -> https://marketplace.microsoft.com/da-dk/product/dynamics-365-business-central/PUBID.continia365%7CAID.6da8dd2f-e698-461f-9147-8e404244dd85%7CPAPPID.6da8dd2f-e698-461f-9147-8e404244dd85?tab=Overview

Thanks,
Aman K

I have the same question (0)
  • Verified answer
    OussamaSabbouh Profile Picture
    1,142 on at
    How to add custom action button (only using AL) to preview PDF?
    Hello,
     
    From Business Central 2025 wave 1, you can preview PDFs natively, no add-ins or OneDrive required.
     
     Use:
     
    File.ViewFromStream() → for SaaS
     
    File.View() → for on-prem
     
     
    These open the PDF directly in the web client viewer from an AL action.
     
    Example:
     
    File.ViewFromStream(InS, 'MyFile.pdf', true);
     
     
    Regards,
    Oussama Sabbouh
  • Verified answer
    Aman Kakkar Profile Picture
    1,025 on at
    How to add custom action button (only using AL) to preview PDF?
     
    That works for me.
     
    Also, anyone else who stuck for this, I found a reference below in standard code in table 137 "Inc. Doc. Attachment Overview"
     
     
     

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sumit Singh Profile Picture

Sumit Singh 2,204

#2
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 1,933

#3
YUN ZHU Profile Picture

YUN ZHU 1,885 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans