At iFacto, we try to keep our product as up to date as possible. Which means that when there are some problems in the Cumulative Updates, we run into them fairly early.
As such, I have found a situation where the MESSAGE does not work as we are used too.
The easiest way to explain the problem is to show you a little sample.
MESSAGE('SAMPLE1:\' + 'line1\line2\line3'); MESSAGE('SAMPLE2:\' + STRSUBSTNO('line1\%1','line2\line3')); MESSAGE('SAMPLE3:\' + 'line1\%1','line2\line3');
Let’s review the code. We basically should expect the 3 examples to print line1, line2 and line 3 on a new line right?
Sample one, just puts all the text into the message directly, sample 2 uses % variables through the STRSUBSTNO, sample 3 just ditches the STRSUBSTNO and puts the % parameter values directly into the MESSAGE parameters.
Let’s look at the actual results:
Was that what you were expecting?
It appears that the MESSAGE parameters is broken, which leads to backslashes not being interpreted as new lines.
I have already logged an incident at Microsoft. Hopefully, in the next Cumulative Update, the problem will be fixed.
For now, all we can do is either:
- Ignore the problem
- Ignore the Cumulative Update
- Use concatenation
- Use STRSUBSTNO