Well, thats the problem. The error occurs in a report on the client's live system. I figured out that some code that strings together reference numbers is the culprit. If I comment that code out the report works fine.
The code loops through a bunch of records and writes the value in one field to a comma seperated text string which is then displayed in the report. The variable for that string is a Text field, size 1024.
I think I've seen this problem. There is a limit on how long the value can be printed in a textbox. I can't remember what the maximum length is. I would put a limit and redesign the report to print on multiple lines.
Ahmed Rashed Amini
Independent Consultant/Developer
Maximum lenght for a textbox is 1024 at least for 4.0SP1. For 3.01 I think it is 256. I tested both with 1024 and 4.0SP1 worked fine, but 3.01 crashed. So I think it follows the maximum length of a text-variable.
It is also possible that there is a limit per section, but I am not sure about this.
Regards,Alain Krikilion No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I found the following quote related to this error message:
It indicates that you try to insert a textstring that is to long for the field.
So you are right: Your text variable 1024 will be filled with more than 1024 characters.
You should check the variable like this:
IF STRLEN(MyTextVar) + STRLEN(MyNewValue) <= MAXSTRLEN(MyTextVar) THEN
MyTextVar := MyTextVar + MyNewValue
ELSE
// Do something other because the new text doesn't fit into the text variable
The maximum length which can be displayed in text box in reports is 1013. I don't know what is the significance of this limit. If anybody finds it please tell me.
Comments
Also turn on the debugger and see were it stops.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
The code loops through a bunch of records and writes the value in one field to a comma seperated text string which is then displayed in the report. The variable for that string is a Text field, size 1024.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
It is also possible that there is a limit per section, but I am not sure about this.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
You should check the variable like this:
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
Regards,
Ravi