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 🙂

Advertisements

About Joseph Velliah
As a SharePoint Developer my professional interests tend to be technical and SharePoint focused. I run a blog at "SP RIDER" where you can expect to read HOW TOs and scenarios that I run into during my day to day job. I hope my posts will give back a little to the community that is helped me.

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

  1. Qite helpful..
    Thanks…:-)

  2. Thank you so much for sharing! I couldn’t find the resolution anywhere! Works just as described.

  3. Divya Vishnu says:

    Hi can you please explain how you have done this as i am going through the same issue and i am new to the nintex. thanks

  4. Hi Divya,

    Are you editing the list display form using SharePoint Designer? Please elaborate

    • Divya Vishnu says:

      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

  5. 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.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: