Apply Line Breaks & Disable Special Characters on Multiline Plain Text Column of SharePoint List Custom Display Form

Problem : 

I have a Multiline Text column in SharePoint list with Plain Text format. Which will show the activity log for each record/item. Using workflow/ event receiver I  have to update this column when ever an item created or modified with the below format:

04/03/2012 10:42:17 AM XYZ created this document 
04/09/2012 10:43:07 AM ABC modified this document
04/15/2012 11:38:59 AM LMN modified this document

Everything was working fine till the time I use SharePoint default Display form. When I tried to customize the custom display form(new display form created and set as default display form using SPD 2010) , the line breaks updated in the Multiline Text column was not rendering with line breaks. It was rendering like one paragraph instead of adding line breaks after each activity log as shown below:

04/03/2012 10:42:17 AM XYZ created this document 04/09/2012 10:43:07 AM ABC modified this document 04/15/2012 11:38:59 AM LMN modified this document

Solution :

To resolve this issue, I used the follwoing XSL expression. It was working as expected.

<xsl:value-of disable-output-escaping=”yes”   select=”ddwrt:AutoNewLine(string(@History))” ddwrt:nbsp-preserve = “yes”/>

Here,

  • History is my Multiline Text column in SharePoint list with Plain Text format
  • ddwrt:AutoNewLine is to apply Line Breaks
  • ddwrt:nbsp-preserve is to Disable Special Characters

Happy SharePointing 🙂

6 thoughts on “Apply Line Breaks & Disable Special Characters on Multiline Plain Text Column of SharePoint List Custom Display Form

    1. Hi,

      Actually its a nintex approval workflow and i have to record the approval information in a text field like submitted on this date approved on this date etc etc…right now in nintex workfow i have tried using Newline action but its not working for me.

      Thanks

      Like

  1. Hi Divya,

    After the approval task action you can add an update item action to update your text field with the required information(approver name, date, approval outcome etc.,) as per your requirement.

    If you are not able do this, please email me your skype id we will have quick chat.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.