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

Notifications

Announcements

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 182
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
    7,560 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,181 Super User 2025 Season 2 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
    96,256 Super User 2025 Season 2 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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,638

#2
YUN ZHU Profile Picture

YUN ZHU 837 Super User 2025 Season 2

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 704 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans