This is how I initialized. After above code if i do message(’’%1’,FORMAT(RecRef.RECORDID,0,10) it returns Cust. Ledger Entry : 29101029 rather than the characters for bookmark. And this is what it goes to URL as well
I found this thread 'cause i had a simular task and i think i found the issue with your code sample: It doesn’t work for Text lenghs from 128 to 255 characters. (that’s because the Binary writer uses every 8th bit in the lenght-bytes to determine if the following byte still belongs to the length-parameter or is the first character of the string.
i didn’t have time to find a more decent fix (i’d like to build one that works with infinite string lenghts) but this is how i made it work:
IF _Note.LENGTH <= 255 THEN BEGIN
Char1 := _Note.LENGTH;
Char2 := 1;
if _Note.LENGTH > 127 THEN
TextToWrite.ADDTEXT(FORMAT(Char2));
TextToWrite.ADDTEXT(FORMAT(Char1));
END ELSE BEGIN
Char1 := 128 + (_Note.LENGTH - 256) MOD 128;
Char2 := 2 + (_Note.LENGTH - 256) DIV 128;
TextToWrite.ADDTEXT(FORMAT(Char1) + FORMAT(Char2));
END;
ok i has some spare time now and finished my code to get some cleaner - less limited functions i tested this for stringleghts from 20 to 20000000 (even though RTC will get performance issues if you actually open the record with the note)
I actually found a much easier way to do this by using .NET variables. It works very well. You can use .NET variable in NAV 6. I wrote a little how to over here:
I don’t know if you’re still having this problem or not. I bashed my head against the wall too. I found a way to read and write notes from classic or RTC without writing, installing or buying 3rd party software. It’s quite simple. I created a how-to here: