Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

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

(1) ShareShare
ReportReport
Posted on by 11
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
    JN-24121209-0 11 on at
    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
    JN-24121209-0 11 on at
    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
    Khushbu Rajvi. 5,371 on at

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,458 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,543 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans