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

Create note - Record Link formatting problem when saving

(0) ShareShare
ReportReport
Posted on by 41

With the same code and only changing the text it produces different results

procedure FillNote()
    var
        Customer: Record Customer;
        RecordLink: Record "Record Link";
        outStr: OutStream;
        MyInStream: InStream;
    begin
        Customer.GET('00000006');
        Clear(RecordLink);
        RecordLink.Init();
        RecordLink."Record ID" := Customer.RecordId();
        RecordLink.Type := RecordLink.Type::Note;
        RecordLink."Link ID" := 0;
        RecordLink.Created := CurrentDateTime;
        RecordLink."User ID" := USERID;
        RecordLink.Company := CompanyName;

        RecordLink.Note.CreateOutStream(outStr, TextEncoding::UTF8);
        outStr.WRITETEXT('1111111111111 2222222222222 33333333333333 444444444444 555555');

        if RecordLink.Insert(true) then
            Message('Si')
        else
            Message('No');
    end;

RESULT:

pastedimage1594249000169v3.png the text is truncated

procedure FillNote()
    var
        Customer: Record Customer;
        RecordLink: Record "Record Link";
        outStr: OutStream;
        MyInStream: InStream;
    begin
        Customer.GET('00000006');
        Clear(RecordLink);
        RecordLink.Init();
        RecordLink."Record ID" := Customer.RecordId();
        RecordLink.Type := RecordLink.Type::Note;
        RecordLink."Link ID" := 0;
        RecordLink.Created := CurrentDateTime;
        RecordLink."User ID" := USERID;
        RecordLink.Company := CompanyName;

        RecordLink.Note.CreateOutStream(outStr, TextEncoding::UTF8);
        outStr.WRITETEXT('AAA BBB CCC DDD EEE FFF');

        if RecordLink.Insert(true) then
            Message('Si')
        else
            Message('No');
    end;

RESULT:

pastedimage1594248994918v2.png the text is invalid

changed to  TextEncoding::Windows I have the same result, what could it be?
I have the same question (0)
  • Verified answer
    Pablogrind Profile Picture
    41 on at

    I have resolved with this code

    RecordLinkManagement: Codeunit "Record Link Management";

    RecordLinkManagement.WriteNote(RecordLink, 'AAA BBB CCC DDD EEE FFF');

    i have based on codeunit 454

  • Suggested answer
    Marco Mels Profile Picture
    Microsoft Employee on at

    Hello,

    Thank you for sharing final solution.

    Thanks.

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

#2
YUN ZHU Profile Picture

YUN ZHU 1,158 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 533 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans