Problem in Sharepoint Infopath form with ''Hyperlink object'' that contain SPACE in the link. - InfoPath Dev
in

InfoPath Dev

Problem in Sharepoint Infopath form with ''Hyperlink object'' that contain SPACE in the link.

Last post 03-10-2011 06:28 AM by kcrossley1. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-09-2011 04:34 PM

    Problem in Sharepoint Infopath form with ''Hyperlink object'' that contain SPACE in the link.

    Hello, 

    I want to put a ''Hyperlink object'' in a Infopath Object where the user put a link. The link can be a http:// or a file:///. If the link have a SPACE after insert the link I click ok and the link have some %20 instead of a SPACE so it's correct. The link is working. After I reopend the form, the link have SPACE instead of %20 and not working anymore.

    The Infopath 2010 form is the form from a Sharepoint list. When I click the link from the sharepoint list it's working (have %20) but if I click the link from the form (in form fill mode) it is not working (cause it have space).

     I try the translate function to replace the  SPACE by %20 but it only change one caracter so it's not working.

     Anyone have a solution to this problem. This problem occur only if  we click on the hyperlink when the ''edit form'' open in a browser. The problem did not occur if you fill the form in Infopath filler.

  • 03-09-2011 05:26 PM In reply to

    Re: Problem in Sharepoint Infopath form with ''Hyperlink object'' that contain SPACE in the link.

    You could solve this a couple ways. First is via a rule by executing a string operation for the replace and then populate the value back into the data field. Second, and more difficult would be to use the XmlFormView on the forms page load event to capture the inbound xml data and convert it via a string.Replace method call. Then put the modified value back into the XmlFormView. Example would be 1) get the source xml data 2) replace the value of the field via string.Replace 3) Assign the value back to the appropriate XPath. Do it on the form via a rule would be the best way though.

  • 03-09-2011 05:45 PM In reply to

    Re: Problem in Sharepoint Infopath form with ''Hyperlink object'' that contain SPACE in the link.

    For the first method the only function I see it the translate(field," ","%20") function. But for a string like ''file:///c:\program files" the conversion is ''file:///c:\program%files'' and the 20 is missing. For the second method I will look at it because I think it's like chinese for me. I think i found a third solution on the internet for a find and replace http://www.inoblog.com/index.php/2009/03/15/replace-text-in-infopath-using-rules/ but it require to install Visual Studio. 

     So you have a specific function that do a find and replace string operation?

  • 03-10-2011 06:28 AM In reply to

    Re: Problem in Sharepoint Infopath form with ''Hyperlink object'' that contain SPACE in the link.

     You will create a rule that has a condition that uses something to the effect of... If myField contains '%20'

    The action would be the action of "set a fields value" followed by myField ( the field that has the hyperlink) with the value having a formula like the following.

    concat(substring-before(.,'%20'), ' ', substring-after(., '%20')) 

    -- Give that a try

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