Fill rich text field with formatted data from list - how can this be done? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Fill rich text field with formatted data from list - how can this be done?

Last post 06-23-2014 06:36 AM by AmsterdamSchool. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 06-20-2014 09:52 AM

    Fill rich text field with formatted data from list - how can this be done?

    I'm trying to pull formatted text from a SharePoint list (Office 365) and display it in a rich text box on my form, with it's original formatting. So far all formatting keeps getting lost in the process. I understand it can be done with code behind. I tried this, but because I don't have SharePoint installed locally this is proving to be surprisingly difficult. I managed to get the microsoft.sharepoint.dll from somewhere, but I still cant run the code. I get error messages about missing namespaces. Cab someone show me an alternative route, or explain how I can use code behind without SharePoint on my machine? I use SharePoint Online 2013, InfoPath 2013 and Visual Studio 2012. I would be very grateful. Thank you. This page explains how it can be done with code behind: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/f9cd50d5-0782-49c0-b71a-e242ff4d5758/how-do-i-retain-formatting-when-setting-fields-value-in-infopath-2010-to-be-formatted-text-from-a?forum=sharepointcustomizationprevious
  • 06-20-2014 10:31 AM In reply to

    Re: Fill rich text field with formatted data from list - how can this be done?

    UPDATE - I am now able to add the code, but it turns out I need admin rights to the site collection in order to upload my form. Not sure if I'll be able to get those and how fast. Is there an non-code solution? Not that I mind doing it in code, but I get stuck on permissions... Thank you
  • 06-20-2014 10:34 AM In reply to

    Re: Fill rich text field with formatted data from list - how can this be done?

    Unfortunately a browser form with code either needs to go in the Sandbox (which means you have to be a site collection admin and publish directly to the library) or be admin approved (which means it is uploaded to central admin. I don't know of a way to do what you want to do without code, however.

    Hilary Stoupa

  • 06-20-2014 10:45 AM In reply to

    Re: Fill rich text field with formatted data from list - how can this be done?

    A shame that there is no codeless solution to do something that seems as straightforward as retrieving formatted text to go into a rich text box. Oh well... Thanks for the explanation Hilary.
  • 06-22-2014 10:31 PM In reply to

    Re: Fill rich text field with formatted data from list - how can this be done?

     If you are ok with having users access the form in Filler mode (in the InfoPath client), then you shouldn't need any elevated permissions to publish the form, just regular Contributor permissions. Is this a browser form?

    Just so you know, qRules provides a command called CopyRichText that makes it really easy to copy rich text from place to place. qRules also provides all sorts of other helpfuly functionality and takes all the hassle out of writing your own code. I recommend checking it out as it can save you lots of time and effort.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 06-23-2014 05:30 AM In reply to

    Re: Fill rich text field with formatted data from list - how can this be done?

    It is a browser form. Should have mentioned that. Filler mode is not an option.

    I'll look into qRules, but I already saw that this also requires sandboxed forms. Curretnly the code is less of a problem than the permission, but worth looking in to.

    Than you.

  • 06-23-2014 06:36 AM In reply to

    Re: Fill rich text field with formatted data from list - how can this be done?

    UPDATE - much easier than expected I did get the permission. However, the next obstacle was just around the corner. The code builds fine, but when I publish it, I get a message that states that the sanbox solution can not be activated because of an error while validating Microsoft.ApplicationServer.Caching.Client. It also states that the solution references the illegal System.Threading.Timer which may not be used in a site collection.


    Why might that be? My code does not use or reference any of the mentioned assemblies etc. It is completely based on this sample code: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/f9cd50d5-0782-49c0-b71a-e242ff4d5758/how-do-i-retain-formatting-when-setting-fields-value-in-infopath-2010-to-be-formatted-text-from-a?forum=sharepointcustomizationprevious

    Does someone understand what could cause these errors if I don't use these assemblies in my code and this is the only code behind used in the form?

    Thank you.

Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.