Skip to main content
Post a question

Notifications

Community site session details

Community site session details

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

How to use the "Doc. Attachment List Factbox" on a custom page

Like (0) ShareShare
ReportReport
Posted on 2 Jan 2025 13:19:07 by 15
Hi, 
 
Apologies for any mistakes as this is my first post. 
 
I have a custom table to which I wish to add the latest document attachment list factbox. 
 
I have been able to do this and have been able to filter attachments to show only those attachments with the table ID and No. of the selected record. 
 
However, I cannot find the correct code to associate new attachments with the selected record on upload. When I select a record and click 'upload files', the resulting attachments are uploaded without reference to the Table ID and Record ID, so they are not displayed in the factbox.
 
I have been able to make it work using a codeunit which uses the older Document Attachment Factbox, but this gives me a warning saying that the Page 'Document Attachment Factbox' is marked for removal. Reason: The "Document Attachment FactBox" has been replaced by "Doc. Attachment List Factbox", which supports multiple files upload.. Tag: 25.0.
 

Version: GB Business Central 25.1 (Platform 25.0.27994.0 + Application 25.1.25873.25976)

Has anyone had success using the new "Doc. Attachment List Factbox" on a custom table and custom page? Any links to working code would be massively appreciated. 

 

Thanks

Joe

 
  • Verified answer
    JN-24121209-0 Profile Picture
    15 on 02 Jan 2025 at 16:34:03
    How to use the "Doc. Attachment List Factbox" on a custom page
    I have managed to fix this by amending the code provided here: Dynamics 365 Business Central: Adding a FactBox with a list of attachments | Dynamics 365 Lab .
     
    To make it work, I changed the to reference to the 'OnBeforeDrillDown' event on the "Document Attachment Factbox" page to instead reference the 'OnAfterGetRecRefFail' event in the "Doc. Attachment List Factbox" page.  
     
    It now works and there are no 'marked for removal' warnings. 

    Thank you Yun Zhu!
  • JN-24121209-0 Profile Picture
    15 on 02 Jan 2025 at 13:49:23
    How to use the "Doc. Attachment List Factbox" on a custom page
    Thank you, but that is the obsolete page. 
    This is the new one: Page "Doc. Attachment List Factbox" | Microsoft Learn
    I assume the code I require uses the OnBeforeDocumentAttachmentDetailsRunModal Event, but I am struggling to get it to work, so if anyone has achieved this, it would be much appreciated. 
    Thanks
    Joe
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    12,438 Super User 2025 Season 1 on 02 Jan 2025 at 13:36:08

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,346 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,462 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Loading complete