[SalesForce] “Visual Lines” attribute for Long Text Area field doesn’t do anything
I created a new field on a custom object, and when creating it, I have the option to specify the amount of visible lines:
But when I look at the object in SF, all the lines are displayed. Why is this? Am I misunderstanding what this option does?
Best Answer
# Visible Lines refers to the number of lines displayed for input (before scrolling) on the New/Edit page. As such it helps control the layout of the form and hints to the user how much data can be entered for the "normal" use case.
If the long text field has more than 3 lines of data (as in your example) - even if it has 1000+ lines of data, the detail page will show all the lines.
In this instance the documentation is correct. Ultimately they are putting \n\r to represent a "new line". When you split the lines, you are looking at \n. This will cause each line to start with \r and is not impacting the way you are reading the string lines in your code.
Best Answer
# Visible Lines
refers to the number of lines displayed for input (before scrolling) on the New/Edit page. As such it helps control the layout of the form and hints to the user how much data can be entered for the "normal" use case.If the long text field has more than 3 lines of data (as in your example) - even if it has 1000+ lines of data, the detail page will show all the lines.