<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>John Wells &#187; SharePoint</title>
	<atom:link href="http://www.jfwhome.com/category/sharepoint/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jfwhome.com</link>
	<description>Knowledge Management and Social Web App Guru</description>
	<lastBuildDate>Mon, 04 Jan 2016 17:26:35 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9</generator>
	<item>
		<title>Creating mailto links in SharePoint with newlines / carriage returns</title>
		<link>http://www.jfwhome.com/2012/06/29/creating-mailto-links-in-sharepoint-with-newlines-carriage-returns/</link>
		<comments>http://www.jfwhome.com/2012/06/29/creating-mailto-links-in-sharepoint-with-newlines-carriage-returns/#comments</comments>
		<pubDate>Fri, 29 Jun 2012 07:36:14 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://www.jfwhome.com/?p=174</guid>
		<description><![CDATA[Creating a mailto: link is usually easy. You just generate a string in the form, e.g.: email@address.com?subject=sub&#038;body=bodytext where sub and body are URL encoded strings. The URL encoding means, for example, you change spaces to %20 and newlines to %0A%0D, among others. The problem with SharePoint is that if you paste the escaped string into&#8230;]]></description>
				<content:encoded><![CDATA[<p>Creating a mailto: link is usually easy. You just generate a string in the form, e.g.:</p>
<p><code>email@address.com?subject=sub&#038;body=bodytext</code></p>
<p>where <code>sub</code> and <code>body</code> are URL encoded strings. The URL encoding means, for example, you change spaces to <code>%20</code> and newlines to <code>%0A%0D</code>, among others.</p>
<p>The problem with SharePoint is that if you paste the escaped string into the HTML view of a content editor web part, SharePoint, in all it&#8217;s wisdom, Converts the escaped strings back into normal text, which means all the newlines (and multiple spaces) are stripped.</p>
<p>This makes it seemingly impossible to create a mailto link with newlines.</p>
<p>Here&#8217;s the solution:<br />
<span id="more-174"></span></p>
<p>The solution is to use JavaScript instead, and paste the lines unescaped into the script. Then make a basic mailto: link as before, but give it an id (in this case, the id is <code>mailtolink</code>). Then the mailto link is overwritted with our desired link, complete with newlines, when the page loads.</p>
<p><code>
<pre>&lt;p&gt;Please &lt;a href=&quot;mailto:address@example.com&quot; id=&quot;mailtolink&quot;&gt;contact us&lt;/a&gt;.&lt;/p&gt;


&lt;script type=&quot;text/javascript&quot;&gt;
// &lt;![CDATA[

var msgRec = 'address@example.com';
var msgSub = 'This is the message subject';
var msgBody = 'This is the full e-mail body\n\nThis is a new line\nAnd another line';

function modifyMailtoLink;
	document.getElementById('mailtolink').href = 'mailto:' + encodeURIComponent(msgRec) + '?subject=' + msgSub + '&#038;body=' + encodeURIComponent(msgBody);
};

_spBodyOnLoadFunctionNames.push('modifyMailtoLink');

// ]]&gt;
&lt;/script&gt;
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jfwhome.com/2012/06/29/creating-mailto-links-in-sharepoint-with-newlines-carriage-returns/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<item>
		<title>Querying subfolders in SharePoint lists using SPAPI and GetListItems()</title>
		<link>http://www.jfwhome.com/2009/11/11/querying-subfolders-in-sharepoint-lists-using-spapi-and-getlistitems/</link>
		<comments>http://www.jfwhome.com/2009/11/11/querying-subfolders-in-sharepoint-lists-using-spapi-and-getlistitems/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 03:20:30 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://www.jfwhome.com/?p=61</guid>
		<description><![CDATA[This took a while to figure out. I&#8217;ve been trying to query the SharePoint lists service using getListItems(). Getting something from inside one folder is easy &#8212; you just set the queryOptions parameter to be &#60;QueryOptions&#62;&#60;Folder&#62;folderName&#60;/Folder&#62;&#60;/QueryOptions&#62;. This works and returns items fron within that folder. But what about subfolders? One would expect it to be&#8230;]]></description>
				<content:encoded><![CDATA[<p>This took a while to figure out. I&#8217;ve been trying to query the SharePoint lists service using getListItems(). </p>
<p>Getting something from inside one folder is easy &#8212; you just set the queryOptions parameter to be <code>&lt;QueryOptions&gt;&lt;Folder&gt;folderName&lt;/Folder&gt;&lt;/QueryOptions&gt;</code>. </p>
<p>This works and returns items fron within that folder. But what about subfolders? </p>
<p><span id="more-61"></span></p>
<p>One would expect it to be simple &#8212; but it is not, replacing folderName with <code>folderName\subFolder</code> does not work &#8212; it still returns items from within folderName.</p>
<p>The solution is simple but non-obvious. For sub-folders, you have to include the name of the list as the first path element &#8212; so the query becomes <code>&lt;QueryOptions&gt;&lt;Folder&gt;listName\folderName\subFolder&lt;/Folder&gt;&lt;/QueryOptions&gt;</code></p>
<p>This doesn&#8217;t seem to be covered in any documentation, and is non-obvious, inconsistent behaviour. It resulted in a lot of wasted time for me. Unsurprising really for the over-complex, proprietary, non-standard mess that is SharePoint.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jfwhome.com/2009/11/11/querying-subfolders-in-sharepoint-lists-using-spapi-and-getlistitems/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
