[Question] TextBuilder Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLArgumentException
I am using a TextBuilder Variable and in an automated Test. The function where it is used uses a return value of Text. When TextBuilder.ToText() is called i get following exception:
Exception of type 'Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLArgumentException' was thrown.
Can somebody help me with this issue?
Hi @OleTeichmann, What version are you running? Do you have a snippet of code that reproduces the problem?
@thpeder already solved the issue, was because of TextBuilder.Replace('','');
@OleTeichmann, I would still like to know how you got the exception, because the compiler should have stopped you from compiling that with an diagnostic saying something like: can't find member of name ",".
@thpeder
AL Language Version: 0.16.19969
procedure ConvertSpecialChars(TextPar : Text) : Text;
var
TextCharBuilder: TextBuilder;
begin
TextCharBuilder.Append(TextPar);
TextCharBuilder.Replace('Ä','Ae');
TextCharBuilder.Replace('','');
exit(TextCharBuilder.ToText());
end;
I got the Error at TextCharBuilder.Replace('','');
That was actually the expected behavior since the first argument should not be empty. Thanks for the feedback 👍