Announcements
I am trying to import a txt file and iam getting this error: The Length of the string is 1188 but it must be less than or equal to 1024
the field is of text and i have mentioned the size to [2000] but still shows this error!!
Any sugestion to solve this issue.
Hi, I have done a similar process before, but when exporting, I hope it can give you some reference.
Thanks.
ZHU
here is my code NorthW
This is my code ,
Can you please share the complete object?
Use rich formatting there is a function for inserting code.
Thanks for the all the replies Now, iam trying to make my field into a blob data type and iam using standard method like how work description works ,by creating two procedures
in the table,
procedure SetWorkDescription(newfield: Text)
var
OutStream: OutStream;
begin
Clear("myfield");
"INTRA_NAME".CreateOutStream(OutStream, TEXTENCODING::UTF8);
OutStream.WriteText(newfield);
Modify();
end;
procedure GetWorkDescription() mynewfield: Text
var
TypeHelper: Codeunit "Type Helper";
InStream: InStream;
begin
CalcFields("myfield");
"INTRA_NAME".CreateInStream(InStream, TEXTENCODING::UTF8);
exit(TypeHelper.TryReadAsTextWithSepAndFieldErrMsg(InStream, TypeHelper.LFSeparator(), FieldName("myfield")));
end;
here what happens is iam trying add the code into the xmlport and on
trigger OnAfterGetRecord()
var
begin
myfield := GetWorkDescription()
end;
but it shows error you cannot use your The name 'GetWorkDescription' does not exist in the current context, so iam really stuck now...
The best idea here would be to write the long text into a blob field instead of using a text variable or a text field.
Maybe also a good idea to try to share your code, then it will be easier to assist you.
hi Sainudheen
As suggest my above Answer if you create 2 Field then also need to use CopyStr function so you can copy data as per length.
For CopyStr function check URL: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/text/text-copystr-method
Hi Zayn
As per the Code and Text Data Type you can use Maximum :1024 Length.
I suggest you create one more field so you can add more Data.
Note: As per the Microsoft document they are working for the Code & Text Length 2048 but we don't have any idea when we get this new changes.
Hi,
Please below attach link.
https://learn.microsoft.com/en-us/business-applications-release-notes/april19/dynamics365-business-central/max-length-of-variable-length-table-fields-has-been-expanded
Many Thanks,
Manan
hi
but your string variable is how long?
my guess is that you have some text variable set to 1024
can you share the code?
DAniele
André Arnaud de Cal...
294,217
Super User 2025 Season 1
Martin Dráb
232,978
Most Valuable Professional
nmaenpaa
101,158
Moderator