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...
Unanswered

Blob field in Record Link table

(0) ShareShare
ReportReport
Posted on by 95

Hi,

I am generating email notifications when notes are inserted, modified or deleted. In the events 'OnAfterInsertEvent' and 'OnAfterModifyEvent' I can retrieve the text of the note using the following code:


Rec.Note.CreateInStream(InStream, TEXTENCODING::UTF8);
CommentRec := TypeHelper.ReadAsTextWithSeparator(InStream, TypeHelper.LFSeparator);


The problem is that in the 'OnBeforeDeleteEvent' and 'OnAfterDeleteEvent' events the text of the note seems to be already deleted, since the code above returns me an empty string. I have used the event recorder and I don't see any interesting events to which I can subscribe. Any suggestion?

Regards.

I have the same question (0)
  • Andy Sather Profile Picture
    Microsoft Employee on at

    Hello  - We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    I will open this up to the community in case they have something to add.

  • MiguelRospa Profile Picture
    95 on at

    Hello, thanks for answering. I have tried to register on the website you indicate but I have not received any email to complete the registration. Could you help me?.

  • Inge M. Bruvik Profile Picture
    1,161 Moderator on at

    In the delete triggers you should use xrec and not rec.

    xrec holdes the value of the record that is about to be deleted. Rec is the current record.

    This is a good video to watch to understand xrec

    www.youtube.com/watch

  • MiguelRospa Profile Picture
    95 on at

    Thank you very much for the answer Inge, but I know how xRec and Rec work. The function header is as follows:

    [EventSubscriber(ObjectType::Table, Database::"Record Link", 'OnAfterDeleteEvent', '', false, false)]
    local procedure OnAfterDeleteEvent(RunTrigger: Boolean; var Rec: Record "Record Link");

    and all fields except the Blob type can be accessed. It seems that before the OnBeforeDeleteEvent is executed this field has already been cleared and unfortunately there doesn't seem to be another event that I can subscribe to.

  • Inge M. Bruvik Profile Picture
    1,161 Moderator on at

    Sorry, i did not realize that you worked in an event trigger. I thought you worked with a table trigger.

    In the OnAfterDelete event you should expect the field to be empty. But in the OnBeforeDelete event it should be possible to get hold of the value that is about to be deleted.

    What version are you on ?

  • MiguelRospa Profile Picture
    95 on at

    That's what I think, that in the OnBeforeDelete event it should be possible to access the blob field, but it is the only field that seems to have been deleted before the event has been executed.

    Version: Business Central 16.1

    Kind regards.

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

#2
YUN ZHU Profile Picture

YUN ZHU 1,047 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans