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...
Suggested Answer

Attachment Indicator for G/L Entries

(5) ShareShare
ReportReport
Posted on by 268
Hello. I am trying to add a custom "Attachment Indicator" field on the G/L Entry table that shows "yes" if the posted entry included attachments and "no" if it did not. I believe I have to create a code unit for this with modify permissions for the G/L entry table. I noticed there are a couple of tables for attachments, but can someone please let me know which attachment table I should check to find if the posted entry had attachments. Also, can someone please advise the best way to trigger the procedure in the custom code unit? Any help/suggestions will be greatly appreciated. Thank you.
I have the same question (0)
  • Suggested answer
    OussamaSabbouh Profile Picture
    10,875 Super User 2026 Season 1 on at
    Hello,
     
    Check Document Attachment table (that’s what the Attachment FactBox uses).
    Don’t store a flag on G/L Entry—calculate it (page field or FlowField) by checking if attachments exist for Rec.RecordId.
    If you must store it, update via Document Attachment insert/delete events, not on posting.
     
    Regards,
    Oussama Sabbouh
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    21,573 Super User 2026 Season 1 on at
    Attachments are saved in Document Attachment (and sometimes Incoming Document) and are linked to the source posted document such as a sales or purchase invoice.
    The correct approach is to add a Boolean field like Has Attachments to the G/L Entry table and populate it during posting using event subscribers, where you can check whether the source document has any records in Document Attachment and then stamp that result on the created G/L Entries. This avoids post-processing and correctly reflects whether the posting originated from a document with attachments.
  • Suggested answer
    YUN ZHU Profile Picture
    97,970 Super User 2026 Season 1 on at
    Hi, hope the followinng posts can give you some hints.
     
    Thanks.
    ZHU

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,155 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,043 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 955 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans