RTC notes

Hi Matt

I am doing something like this.

CustLedgerEntery.RESET

CustLedgerEntry.SETRANGE(Entry No,29101029)

IF CustLedgerEntry.FIND(’-’) THEN

CLEAR(RecRef);
RecRef.GETTABLE(recCustLedgerEntry);

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

Am I doing something wrong here?

Thanks

Sorry above its RecRef.GETTABLE(CustLedgerEntry) rather than RecRef.GETTABLE(recCustLedgerEntry);

Thanks

Hi,

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;

TextToWrite.ADDTEXT(_Note);

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)

feel free to use it for yourself

Variables:
i - integer
string - Bigtext
strLength - Integer
lengthStr - text[30]
char1 - char

Code:

FOR i := 1 TO 160 DO // generate some string

string.ADDTEXT(‘1’);

strLength := string.LENGTH;

WHILE (strLength DIV 128) > 0 DO BEGIN

char1 := strLength MOD 128 + 128;

strLength := strLength DIV 128;

lengthStr += FORMAT(char1);

END;

char1 := strLength;

lengthStr += FORMAT(char1);

string.ADDTEXT(lengthStr, 1);

Hi Guys,

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:

http://www.sbsintellect.co.za/index.php/2012/03/custom-automated-notes-in-dynamics-nav-rtc-2/

Let me know if you have any questions.

Regards,

Vince

Hi Guys,

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:

http://www.sbsintellect.co.za/index.php/2012/03/custom-automated-notes-in-dynamics-nav-rtc-2/

Regards,

Vincent Connell