2

We created a field of type "Formula" with Formula Return Type "Text" and the Advanced Formula (using the BR function):

'Line1' + BR() + 'Line2' + BR() + 'Line3'

This field was included in Compact Layout and in Page Layout. The field is sometimes (randomly (!)) displayed correctly (3 lines with line breaks, also see first screenshot)

Line1
Line2
Line3

and sometimes as HTML markup (also see second screenshot):

Line1<br>Line2<br>Line3

The same happens using the IMAGE function or any other function generating HTML markup.

In case of correct display the HTML source for this snippet is

<p class="slds-text-body--regular  slds-truncate" data-aura-rendered-by="307:719;a">
    <span data-aura-rendered-by="298:719;a">
        Line1<br data-aura-rendered-by="300:719;a">Line2<br data-aura-rendered-by="300:719;a">Line3
    </span>
</p>

In case of incorrect display the HTML source is

<p class="slds-text-body--regular  slds-truncate" data-aura-rendered-by="307:719;a">
    <span data-aura-rendered-by="298:719;a" class="uiOutputText" data-aura-class="uiOutputText">
        Line1&lt;br&gt;Line2&lt;br&gt;Line3
    </span>
</p>
  • We're using a sandbox with Winter'18 release
  • the same happens in production evironment and
  • both in Lightning Experience and Salesforce classic
  • in all browsers

Is this a known problem? How can this be fixed?

Correct display

Incorrect display

  • Is it the same in all browsers? – ChristianJuul Oct 5 '17 at 7:26
  • I think the issue is probably indeed the browser that sometimes generates the layout themselves, interpreting it as rich text and otherwise just as text - in which case you see the HTML. A possible workaround (I think) is to define a rich text field and fill it with that data :) – Koen Certyn Oct 5 '17 at 7:32
  • @KoenCertyn In this case rich text field works, but not in case of referencing other fields (the 'TestN' strings are just to simplify the problem description). – Uli Grüner Oct 5 '17 at 8:10
  • You can use workflow rules/PB to complete the reference to the other fields to complete the rich text field, no? – Koen Certyn Oct 5 '17 at 8:22
  • @KoenCertyn Ok, I've to look at this workflow rules/PB functionality, currently I'm not familiar with this. Formula field is just simple to use, so if there is a solution I would prefer using formulas. – Uli Grüner Oct 5 '17 at 8:42
0

Was secretly fixed by Salesforce. No more problems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.