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

Notifications

Announcements

No record found.

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

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 2,135

#2
YUN ZHU Profile Picture

YUN ZHU 733 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 612

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans