How do I insert a carriage return into message text?
I am using Pega Robot Studio version 19.1.91 trying to format message text with carriage returns. The stringUtils MessageDialog message text includes the \n to indicate where the new line should begin. However, the message text displays the \n in plain text rather than interpreting it as a line break. I have also tried using the string.Format with the same result. I do not see where I can access the System.Environment.NewLine to generate the line break.
@DarrellE If you are typing the text into the parameter, you can simply press “enter” between lines and it will appear there. If your message is variable, then you can use the StringUtils Concat or Format method and just press the enter key at the right location.
If you want to pass in a newline, you can reach the static property by;
Right-click on the Toolbox and select “Choose Items”.
Select the “Pega Robot Static Members” tab.
Select the “From Global Assembly Cache” radio button.
From the “Assembly” combo box, select the “mscorlib, Version=4.0.0.0”.
Pro-tip, click the letter “n” on your keyboard and scroll up to find this assembly rather than scroll down from “m” as this is closer.
Locate and expand the “Environment” node and check the check box next to “NewLine” to add it to the Toolbox.
@DarrellE When formatting a message using StringUtils or the MessageBox, just press Enter in the middle of your message to add a new line. Each of those textboxes are multi-line textboxes and will format the text as you see it.