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 :
Microsoft Dynamics NAV (Archived)

Modifications of Notes of records

(0) ShareShare
ReportReport
Posted on by

Hello guys .

I have to modify a note related to a specific record in nav. It is a blob .Any ideas on how to get the actual note , modify it and save the new note.
Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
  • Community Member Profile Picture
    on at

    Hello 
    I have that code already because i needed that too.I am having problems with modifying.
    Thanks however

  • Suggested answer
    Guillem Padilla Profile Picture
    427 on at

    Hi,

    I have used this code to modify blob content in a page as a text variable

    Name	        DataType	Subtype
    TextVar Text InStr InStream
    OutStr OutStream
    Buffer Text
    BinaryReader DotNet System.IO.BinaryReader.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    BinaryWriter DotNet System.IO.BinaryWriter.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    Encoding DotNet System.Text.Encoding.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    //Set BLOB value into TextVar
    CALCFIELDS("Your BLOB");
      "Your BLOB".CREATEINSTREAM(InStr);
      BinaryReader := BinaryReader.BinaryReader(InStr, Encoding.UTF8);
      IF NOT ISNULL(BinaryReader) THEN BEGIN  
        IF BinaryReader.BaseStream.Length > 0 THEN
          TextVar := BinaryReader.ReadString;
        BinaryReader.Close;
      END;

    // TODO: Make your modifications in TextVar
    //Set TextVar value into BLOB
    CLEAR("Your BLOB");
    "Your BLOB".CREATEOUTSTREAM(OutStr);
    BinaryWriter := BinaryWriter.BinaryWriter(OutStr,Encoding.UTF8);
    BinaryWriter.Write(TextVar);
    BinaryWriter.Close;
    

    //Show BLOB value
    CALCFIELDS("Your BLOB");
    MESSAGE(FORMAT("Your BLOB"));
  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    What problems you are having, you need to read the note using the method provided in the above link and modify it.

  • Community Member Profile Picture
    on at

    me-ngjyrA.PNGI have the following queue. I should click Edit and it opens the edit subpage where i type the new text. When i click Ok it shoul update the Notes Factbox. Test Note should convert to the text i enter in the Edit form. But the problem i have is it doesnt update :/

    Thank you for your above help.

  • Community Member Profile Picture
    on at

    I entered the Read Text at Edit action and the write to On query close page of the own page.The code is above :

    OnQueryClosePage(CloseAction : Action None) : Boolean

    IF CloseAction IN [ACTION::OK] THEN

     BEGIN

       RecRef.GETTABLE(Product);

       IF Product.FINDFIRST THEN

         BEGIN

           RecordLink.RESET;

           RecordLink.SETRANGE("Record ID",Product.RECORDID);

           IF RecordLink.FINDFIRST THEN

             BEGIN

                  IF Notes <> '' THEN

                  BEGIN

                  Rec.Note.CREATEOUTSTREAM(outStr);

                  BinaryWriter := BinaryWriter.BinaryWriter(outStr,Encoding.UTF8);

                  BinaryWriter.Write(Notes);

                  Rec.MODIFY();

                  BinaryWriter.Close;

                  CALCFIELDS(Note);

                  //MESSAGE(FORMAT(Note));

                  END;

               END;

           END;

           CurrPage.UPDATE(TRUE);

        END;

    EditNotes - OnAction()

    //MESSAGE('Implementare funzionalità');

    PAGE.RUN(51266);

    RecordLink.GET("Link ID");

    IF RecordLink.FINDFIRST THEN BEGIN

    RecordLink.CALCFIELDS(Note);

    Rec.Note.CREATEINSTREAM(Stream);

    BinaryReader := BinaryReader.BinaryReader(Stream,Encoding.UTF8);

    IF NOT ISNULL(BinaryReader) THEN BEGIN

     IF BinaryReader.BaseStream.Length > 0 THEN

       Notes := BinaryReader.ReadString;

     BinaryReader.Close;

    END;

    END;

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 > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans