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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

How to add a Doc. Attachment List Factbox to a custom page in BC

(5) ShareShare
ReportReport
Posted on by 268
Hello, can someone please guide me on how to add a Doc. Attachment List Factbox to a custom page using AL code?
 
 
 
This is how I tried adding it to my custom page:
 
 
 
When I try to upload a file, I am receiving the error below:
 
 
 
Any help would be greatly appreciated. Thank you!
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    98,122 Super User 2026 Season 1 on at
    Hi, hope the following can give you some hints.
    Dynamics 365 Business Central: How to add Attachments, Links, Notes Factbox to any pages
    Dynamics 365 Business Central: Displaying Sales Lines Attachments in a Factbox of Sales Order (42, Document) page
    Dynamics 365 Business Central: How to copy attachments from Warehouse Receipt to Posted Warehouse Receipt – Customization
     
    Thanks.
    ZHU
  • AK-13051749-0 Profile Picture
    268 on at
    Thank you for sharing the links.
     
     
    Referring to the link above, since the Document Attachment Factbox is marked for removal and now replaced with Doc. Attachment List Factbox, I am receiving an error in the first event subscriber for 'OnBeforeDrillDown.' Could you please suggest how to resolve this?
     
  • Verified answer
    Pallavi Phade Profile Picture
    5,292 Super User 2026 Season 1 on at
     
    Hope this Community Thread should help .
     
     
     
    Warm Regards
    Pallavi Phade
    www.linkedin.com/in/pallaviphade131116
  • Suggested answer
    OussamaSabbouh Profile Picture
    11,106 Super User 2026 Season 1 on at
    Hello,
     
    That error (“The record is not open.”) typically means the parent record hasn’t been saved yet or the FactBox isn’t linked to a real stored primary key. The Doc. Attachment FactBox requires a committed record so it can write the correct "Table ID" and "No." into Document Attachment. Make sure your page is not SourceTableTemporary = true, ensure the SubPageLink points to the actual primary key field stored on the table (for example field("No.") if that’s the PK), and confirm the record is saved before users upload files (users can navigate off the field to auto-save, or you can call CurrPage.SaveRecord() before opening attachments). If the PK is "ECO No.", link to that only if it is the real table key field. Once the record exists in the database and the link references the true key field, the upload will work.
     
    Regards,
    Oussama Sabbouh
  • AK-13051749-0 Profile Picture
    268 on at
    Thank you. My primary key is actually the No. field but the field type is Integer so I am receiving the error below.
     
    I used the ECO No. field earlier in the SubPageLink property because the field type for that is Code and it contains the same value as the No. but converted from Integer to Code. Could you please suggest how I can resolve this error?
     
  • Suggested answer
    AK-13051749-0 Profile Picture
    268 on at
    Thank you everyone for the suggestions and links to references!
     
    I was able to use the ECO No. field in the SubPageLink property and added the Event Subscribers below. It is now working correctly!
     
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,032 Super User 2026 Season 1

#2
Dhiren Nagar Profile Picture

Dhiren Nagar 1,049 Super User 2026 Season 1

#3
YUN ZHU Profile Picture

YUN ZHU 1,029 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans