AL
AL copied to clipboard
Passing Labels for Text parameter
In C/AL you can pass a TextConst to a function that takes a Text parameter. In AL TextConst are replaced by Labels.
I've declared a label as:
which I'm trying to pass into this function that takes a text parameter:

It doesnt like it, returning the following error:

If I pass in 'Test Connection' directly in the function call as a text, it doesn't complain. I'll have to declare a text variable and assign to it. Or use...
TempFile.Write(Format(TestConnectionTxt));
Looks like an issue with handling labels as texts