Feedback Form Carriage Return Line Feeds Stripped
Search for an answer or ask a question of the zone or Customer Support. Need help? Dismiss Welcome to Support!
I have a text formula to which I would like to add a carriage return/line break. I tried concatenating chr(13) and chr(10), but the validation didn't like it. Is this possible? I asked Salesforce Support the same question in June as was told "this feature is not available". They did, however, promise to submit it as a feature request to the development team. There is a new formula function called BR() in the Winter '07 release. This will allow you to insert an HTML line break tag into text formula expressions. For example (using made-up field names): Cheers, This was selected as the best answer Looks good! I assume that this will work with text formulas for a Mail Merge? What I am trying to do is have users check boxes that indicate the capabilities we offer, based on the boxes checked, a capability description is created. I would like a carriage return between each so that when they are shown in the Word document they are each on their own line. Will the BR() let me do this? Also, when will the 07 be released? The BR() tag works on formulae in salesforce, however when inserting a multi-row formula to a visualforce page (rendering as pdf) returns a result on one line rather than keeping the line breaks. Both \n and br() don't seem to work. And while were at it, does anyone know how to create a page break (new page) when a Visualforce page is rendered as PDF? Thanks Just in case you didn't find this anywhere else, I was looking for the same thing and found it in a post here. <div style="page-break-after: always;"> </div> will do it. HTH Jeremy I think that the "\n" will work for the Carriage Return case: sReason = 'Retired'; newRec.Description__C = '*** Reason for Archiving ***'; newRec.Description__c += '\n\n' + sReason; Both \n and br() don't seem to work. BR() also works for PDF generation if you're using apex:outputText with escape=false in your PDF: I know this is an old thread but I'm unable to get this to work in a field update workflow rule. There is what I have in my workflow rule update: Did you ever get this to work? I'm having the same issue. Visual Workflows (not apex/visual page) seem to be different as well.. I'm trying to assign a variable to Case Description and a constant variable CR set to \r\n ie {!varCaseDescription} equals Steps{!CR}Line2{!CR}Line2{!CR}Line3 The \r\n gets to the description field as literals and not converted to their cr/lf codes. I noticed that html tags also get stripped out. (ie, <p> or <br>) Is there a way to do this? There is an existing function BR(), which is to add line break in text formula For example: Contact__r.FirstName & " " & Contact__r.LastName & BR() This returns John Doe Hauptstrasse 1234 88888 Munich Bayern Germany Bing Maletz I just noticed that function BR() only works with data type "Text Area" and "Text Area (Long)". It doesn't work with "Text Area (Rich)". Bing Maletz BR() litterally only works when you want HTML formatting. If for example your formula field is being returned by an api call, this is probably not what you want... One way that does allow you to insert a new line or any other special characters is to use labels. For example, I have a label called NewLine. The text of the label is litterally: < From within a formula field I can reference this like: TRIM(Address_Line1__c+MID($Label.NewLine,1,1) Note, the label needs to have the dummy starting end ending characters, because all leading and trailing whitespace will be removed. For info, using the bounding < and > characters also works when constructing text withing visual flow formulae. However, rather than using a label, you need to create the item by using the 'Text Templates' resource and referring to it in the formula contruction. If the text teplate is called bounded_newline and consists of: < then MID({!bounded_newline},2,1) will produce a newline character In a visual flow formula field which populates a custom field of type Long Text Area(32768), I cannot add a line break. So frustrating that this should be the most difficult part of a very complex Flow. @brian, try this hack out, it worked for me https://automationchampion.com/2015/08/06/getting-started-with-process-builder-part-40-adding-a-line-break-in-process-builder-formula/#comment-3963 Thanks Patrick Maxwell 2, that was a great trick! It's not working as expected in my current Process Builder, but i think it got me a step closer! I just tried all the most common mentioned in the post, I got my text field as it should be with sometext abc BR() didn't worked so as '\n' the <br/> worked if you put it in single quotas I am uploading using a field from MS-SQL and used chr(10) (outside of quotes) - seems to work a treat. I know i am picking a very old thread. But guys plz help me put on this.i am facing a similiar issue I have a flow that populates the content of a ContentNote record. i use a formula that combines values from various variables in the flow and concatenate it.This concatenated text is displayed in the body of the contentNote record. Hi @Meenakshi, I know how annoying this is, so I'll attempt to answer this for you, but recommend that you review the link I provided above for help. I don't know what value is in the variable {!NewLinetext} in your screenshot above, but it were this value, it should work (quotes not required.) "~ ~" I don't know if this "trick" will work if that variable is a flow variable. The way I do this is using a custom label (Setup->Create->Custom Label) and passing that variable/reference in my SUBSTITUTE formula. Good Luck! Here is how you can incorporate a carriage return in a message that you want to send in an email within a Process Flow. 1. Create a custom label (Setup/Create/Custom Labels) – I called mine MedPro_Line_Feed. The value is a carriage return surrounded by pipes (i.e., "|"). See Figure 1. 2. Then you want to create a formula field in your Flow where you concatenate the MedPro_Line_Feed in your message – please note that the pipes "|" are substituted out of the message so you are left with just the carriage return. 3. Add the formula field as the body of the email to be sent. I used simple email where you identify subject, body, Email addresses. Figure 1: Create new Custom Label Value | Figure 2: Create a formula field as text with the following: try this below 'Hi'+'<br><br><br><br>'+'Thank you for contacting us.' None of the BR(),'BR()', '<br>', '<br />' work in the Process Builder, using a long text field. After 13 years, why hasn't Salesforce fixed this? Dismiss
James McGill
Add a carriage return/line break to a custom formula
Best Answer chosen by Admin(Salesforce Developers)
All Answers
KML
EricB
Code: Address1 & BR() &
Address2 & BR() &
City & ", " & State & " " & PostalCode & BR() &
Country
Eric Bezar
salesforce.com Product Management James McGill
Phil_R
Does anyone have any other suggestions?
Thanks,
Phil beener
JeremyKraybill
boihue
eto
Phil_R wrote:
The BR() tag works on formulae in salesforce, however when inserting a multi-row formula to a visualforce page (rendering as pdf) returns a result on one line rather than keeping the line breaks.
Does anyone have any other suggestions?
<apex:outputText escape="false" value="{!yourfield}>
fifedog15
"1.0 This Order .... by both parties." & BR() & "2.0 Standard.... the Special Terms section." However this is what the output is on screen: 1.0 This Order .... by both parties. 2.0 Standard .... the Special Terms section.
Rifleman
KevinBr
Bing
&Contact__r.MailingStreet &BR()
&Contact__r.MailingPostalCode& " "& Contact__r.MailingCity & BR()
& Contact__r.MailingState & BR()
& Contact__r.MailingCountry Bing
docbill
>
+Address_Line2__c+MID($Label.NewLine,1,1)
+Address_Line3__c+MID($Label.NewLine,1,1)
+Address_Line4__c) Steve Cox 9
> Brian Oconnell 23
I've tried BR(), \n\r, <br/>, Text Templates, etc. Patrick Maxwell 2
Kendra Von Achen
Moggy
'sometext ' & a variable & '<br/>' & sometext
sometext John Ondusko 2
Mee Sharma
I am facing issues in adding linebreaks between the two concatenated formulas.I have tried everything BR(),
, /n,/r,
,Substitute((text),"~","").Nothing seems to work.Plz help!
Patrick Maxwell 2
Rich Finn 2
Custom Label Detail
Short Description MedPro Line FeedName
Language English
|
"Please review the Contact information listed below to see if a duplicate record exists." & SUBSTITUTE($Label.MedPro_Line_Feed, "|", "") & SUBSTITUTE($Label.MedPro_Line_Feed, "|", "") & "Contact Name / ID : " & {!v_Name_Formula} &" / " & {!v_CONTACTID_Found} &SUBSTITUTE(
$Label.MedPro_Line_Feed , "|", "") & SUBSTITUTE( $Label.MedPro_Line_Feed , "|", "")
&" Email : " & {!v_Contact_Email} & SUBSTITUTE( $Label.MedPro_Line_Feed , "|", "")&SUBSTITUTE( $Label.MedPro_Line_Feed , "|", "") & " Thank you." Rabbani Basha 1
it's working fine. Kristi Ward
You need to sign in to do that.
Source: https://developer.salesforce.com/forums/?id=906F00000008v7VIAQ
There is a new formula function called BR() in the Winter '07 release. This will allow you to insert an HTML line break tag into text formula expressions.
For example (using made-up field names):
Code:
Cheers,
Eric Bezar
salesforce.com Product Management