NAV 2016 - Writing multiple lines in Record link table in Notes

rnjbngrnjbng Posts: 69Member
Hi Folks -

In the Record link table I need to write multiple lines in the Notes blob field. I tried using the below function, it works for 1 line using the standard NAV Settext function. I tried calling the same function with different text but it takes the last one. How can I write multiple lines in the Notes blob field. Something like
Customer No - 10000
Credit limit - 20000
Division - 100

Any help is highly appreciated. Thanks RJ

RecordLink.RESET;
RecordLink.INIT;
RecordLink."Link ID" := LinkNo;
RecordLink."Record ID" := RecRef.RECORDID;
RecordLink.URL1 := GETURL(CLIENTTYPE::Current, COMPANYNAME, OBJECTTYPE::Page, PAGE::"Customer Card");
RecordLink.Type := RecordLink.Type::Note;
RecordLink.Created := CURRENTDATETIME;
RecordLink."User ID":=USERID;
RecordLink."To User ID" := "To user ID";
RecordLink.Company:=COMPANYNAME;
RecordLink.Notify := TRUE;
SetText('Customer No. - 10000',RecordLink);
SetText('Credit Limit - 20000',RecordLink);
SetText('Division Code - 1100',Recordlink);

RecordLink.INSERT;


LOCAL SetText(NoteText : Text;VAR RecordLink : Record "Record Link")
ps := NoteText;
SystemUTF8Encoder := SystemUTF8Encoder.UTF8Encoding;
SystemByteArray := SystemUTF8Encoder.GetBytes(s);

RecordLink.Note.CREATEOUTSTREAM(Ostr);
lx := SystemByteArray.Length DIV 128;
IF x > 1 THEN
y := SystemByteArray.Length - 128 * (x - 1)
ELSE
y := SystemByteArray.Length;
c1 := y;
Ostr.WRITE(c1);
IF x > 0 THEN BEGIN
c2 := x;
Ostr.WRITE(c2);
END;
FOR i := 0 TO SystemByteArray.Length - 1 DO BEGIN
c1 := SystemByteArray.GetValue(i);
Ostr.WRITE(c1);
END;
Sign In or Register to comment.