<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Thiru's SharePoint Blogs</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/thirusrinivasan1/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/thirusrinivasan1/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 04:05:39 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Encrypting SharePoint SQL Connections [Clustered &amp; Non Clustered]</title>
      <link>https://docs.microsoft.com/archive/blogs/thirusrinivasan1/encrypting-sharepoint-sql-connections-clustered-non-clustered</link>
      <pubDate>Mon, 28 Sep 2015 05:12:00 GMT</pubDate>
      <dc:creator><![CDATA[Thiru Srinivasan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/thirusrinivasan1/2015/09/28/encrypting-sharepoint-sql-connections-clustered-non-clustered/</guid>
      <description><![CDATA[To configure the non-clustered server to accept encrypted connections


Ensure the SQL Service...]]></description>
      <content:encoded><![CDATA[<p><span style="color: #008ac8; font-family: Segoe UI; font-size: large;">To configure the non-clustered server to accept encrypted connections</span></p>
<ol>
<li>
<p>Ensure the SQL Service Account (Ex: <strong>SVC01)</strong> has been enabled admin access on the SQL server machine.</p>
</li>
<li>
<p>Login to SQL server using <strong>SVC01</strong> account.</p>
</li>
<li>
<p>In SQL Server Configuration Manager, expand SQL Server Network Configuration, right-click Protocols for &lt;server instance&gt;, and then selectProperties.</p>
</li>
<li>
<p>In the Protocols for &lt;instance name&gt; Properties dialog box, on the Certificate tab, select the desired certificate from the drop down for the Certificate box, and then click OK.</p>
</li>
<li>
<p>On the Flags tab, in the ForceEncryption box, select Yes, and then click OK to close the dialog box.</p>
</li>
<li>
<p>Restart the SQL Server service.</p>
</li>
</ol>
<p><span style="color: #008ac8; font-family: Segoe UI; font-size: large;">To configure the Clustered server to accept encrypted connections</span></p>
<ol>
<li>
<p>Ensure the <strong>SVC01</strong> account has been enabled admin access on the SQL server machine.</p>
</li>
<li>
<p>Login to SQL server using <strong>SVC01</strong> account.</p>
</li>
<li>
<p>In SQL Server Configuration Manager, expand SQL Server Network Configuration, right-click Protocols for &lt;server instance&gt;, and then selectProperties.</p>
</li>
<li>
<p>On the Flags tab, in the ForceEncryption box, select Yes, and then click OK to close the dialog box.</p>
</li>
<li>
<p>Since this is a clustered environment the certificate installed on the previous step will not be visible on the Certificate tab. Hence the certificate needs to be associated through a registry entry update as described in the following section.</p>
</li>
<li>
<p>Click OK.</p>
</li>
<li>
<p>Export the certificate thumbprint by running this command on elevated command window.</p>
<p><strong>certutil&nbsp; &ndash;store &ndash;user my &gt; cert.txt</strong></p>
</li>
<li>
<p>Open the cert.txt file and find the property <strong>Cert Hash(sha1):</strong> corresponding to the cluster certificate.</p>
</li>
<li>
<p>Copy the hex value to Notepad and remove the spaces.</p>
</li>
<li>
<p>Start <strong>Regedit</strong> and copy the hex value to this key: <strong>HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\&lt;YourSQLServerInstance&gt;\MSSQLServer\SuperSocketNetLib\Certificate</strong></p>
</li>
<li>
<p>Restart the SQL Server service.</p>
</li>
<li>
<p>Perform the same steps on other nodes of the SQL cluster.</p>
</li>
</ol>
<p><span style="color: #008ac8; font-family: Segoe UI; font-size: large;">To configure the SharePoint servers to request encrypted connections</span></p>
<ol>
<li>
<p>Logon to every server instance on the SharePoint farm</p>
</li>
<li>
<p>Copy either the original certificate or the exported certificate file to the client computer.</p>
</li>
<li>
<p>On the client computer, use the Certificates snap-in to install either the root certificate or the exported certificate file.</p>
</li>
<li>
<p>In the console pane, right-click SQL Server Native Client Configuration, and then click Properties.</p>
</li>
<li>
<p>On the Flags page, in the Force protocol encryption box, click Yes</p>
</li>
</ol>]]></content:encoded>
    </item>
    <item>
      <title>Updating SharePoint Content Search Web Part (CSWP) properties after Deployment</title>
      <link>https://docs.microsoft.com/archive/blogs/thirusrinivasan1/updating-sharepoint-content-search-web-part-cswp-properties-after-deployment</link>
      <pubDate>Mon, 28 Sep 2015 04:31:00 GMT</pubDate>
      <dc:creator><![CDATA[Thiru Srinivasan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/thirusrinivasan1/2015/09/28/updating-sharepoint-content-search-web-part-cswp-properties-after-deployment/</guid>
      <description><![CDATA[In SharePoint Custom solutions,&nbsp;the Content Search Web Parts (CSWP) might require minor...]]></description>
      <content:encoded><![CDATA[<p style="text-align: left;">In SharePoint Custom solutions,&nbsp;the Content Search Web Parts (CSWP) might require minor property updates after the deployment, which is not feasible through UI. The typical example could be enabling/disabling of Cache. This could be cumbersome in case of updating multiple web parts across pages/sites.</p>
<p style="text-align: left;">Sometime there might be needs to asses&nbsp;the property values associated with web part's to validate the faulty behaviors.&nbsp;During such scenarios a script might be handy for a quick validation of the CSWPs.</p>
<p style="text-align: left;">I came across such situations during an engagement which forced me to write a <strong><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/64/42/10/UpdateContentWebpartProps.ps1" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-64-42-10/UpdateContentWebpartProps.ps1">PowerShell script</a></strong> which&nbsp;can help me to make the task much simpler.</p>
<p style="text-align: left;">Share the same for someone who may need this sometime.</p>
<p style="text-align: left;">This PowerShell script can be run on 2 modes (Read Only or Update) by setting the input parameter $saveChanges.</p>
<p style="text-align: left;">When executed on readOnly mode ($saveChanges = $false) the script will only find the pages and web parts where the changes are required and will NOT update any web parts.</p>
<p style="text-align: left;">Where as the Update Mode ($saveChanges = $true) will find the $strToFind and UPDATE the matches with the $stringToReplace.</p>
<table border="1" cellspacing="0" cellpadding="10">
<tbody>
<tr>
<td>
<p><span style="color: #000080;">$stringToFind = @('"Local SharePoint Search Results"') # $stringToFind = @('"TryCache":true','\"TryCache\":true')</span><br /><span style="color: #000080;">$stringToReplace = @('"Custom SharePoint Search Results"') # $stringToReplace = @('"TryCache":false','\"TryCache\":false')</span><br /><span style="color: #000080;">$siteUrl = "<a href="http://contoso.com:9996/test"><span style="color: #000080;">http://contoso.com:9996/test</span></a>"</span><br /><span style="color: #000080;">$saveChanges = $false;</span></p>
<p><span style="color: #000080;">function UpdateSearchWebParts([Microsoft.SharePoint.SPSite] $site)</span><br /><span style="color: #000080;">{</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp; Write-Host "Updating Content search Webpart source string:"$stringToFind " with Target string " $stringToReplace</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp; foreach($web in $site.AllWebs)</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp; {</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write-Host "Validating web "$web.Url</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $pagesList = $web.Lists.TryGetList("pages")</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($pagesList -ne $null)</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($pageItem in $pagesList.Items)</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Make sure you specify which page needs changes</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $page = $web.GetFile($pageItem.Url)</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write-Host "Validating page "$page.Title "with Url"$pageItem.Url</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($page.CheckOutStatus -ne "None")</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Check to ensure the page is checked out by same user, and if so, check it in</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($page.CheckedOutBy.UserLogin -eq $web.CurrentUser.UserLogin)</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $page.CheckIn("Page checked in automatically by PowerShell script")</span></p>
<p><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write-Output $page.Title"("$page.Name") has been checked in"</span></p>
<p><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($page.CheckOutStatus -eq "None")</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $page.CheckOut()</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $wpm = $web.GetLimitedWebPartManager($page.Url, [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)&nbsp; </span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($wp in $wpm.WebParts)</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($wp.GetType().ToString().Contains("ContentBySearchWebPart") -eq $true)</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; write-host "Validating webpart "$wp.Title" on zone "$wp.ZoneID</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $json = $wp.DataProviderJSON;</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $newJson = $json;</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #write-host $json;</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $index = 0;</span></p>
<p><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($stf in $stringToFind)</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($newJson.Contains($stf) -eq $true)</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $newJson = $newJson.Replace($stf, $stringToReplace[$index]);</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $index++;</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #write-host $newJson;</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($json.Equals($newJson) -eq $false)</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; write-host "Webpart "$wp.Title" on zone "$wp.ZoneID" requires update.." -ForegroundColor Yellow</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($saveChanges -eq $true)</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; write-host "Updating webpart "$wp.Title" on zone "$wp.ZoneID</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $wp.DataProviderJSON = $newJson;</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $wpm.SaveChanges($wp)</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; write-host "Webpart "$wp.Title" on zone "$wp.ZoneID " updated successfully" -ForegroundColor Green</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; write-host "No change required on Webpart" -ForegroundColor Green</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $page.CheckIn(&ldquo;Update via PowerShell&rdquo;,[Microsoft.SharePoint.SPCheckinType]::MajorCheckIn)</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $page.Publish("Search webparts Updated by powershell")</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="color: #000080;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="color: #000080;">}</span></p>
<p><span style="color: #000080;">$site = new-object Microsoft.SharePoint.SPSite($siteUrl)</span><br /><span style="color: #000080;">UpdateSearchWebParts -site $site</span></p>
<p><span style="color: #000080;">$web = $null;</span><br /><span style="color: #000080;">$site = $null;</span></p>
</td>
</tr>
</tbody>
</table>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/64/42/10/UpdateContentWebpartProps.ps1" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-64-42-10/UpdateContentWebpartProps.ps1">UpdateContentWebpartProps.ps1</a></p>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint- Export/Import Managed Metadata Terms through CSV</title>
      <link>https://docs.microsoft.com/archive/blogs/thirusrinivasan1/sharepoint-exportimport-managed-metadata-terms-through-csv</link>
      <pubDate>Mon, 28 Sep 2015 04:14:00 GMT</pubDate>
      <dc:creator><![CDATA[Thiru Srinivasan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/thirusrinivasan1/2015/09/28/sharepoint-exportimport-managed-metadata-terms-through-csv/</guid>
      <description><![CDATA[This custom PowerShell script is to export the SharePoint Managed Metadata term store into a CSV...]]></description>
      <content:encoded><![CDATA[<p><span>This custom PowerShell script is to export the SharePoint Managed Metadata term store into a CSV file. Please make a note that this script would be handy when there is a need to move the managed metadata across environments where the IDs doesn&rsquo;t matter. </span></p>
<p><span>The script would be completed by the import script which would allow the admins to add/update the items through the CSV itself.</span></p>
<p><span>These scripts would be helpful when there is need of synchronizing the MMS across environments or to export the MMS to excel for some non-technical needs.</span></p>
<p><span>Exporting the SharePoint Managed Metadata</span></p>
<ul>
<li>
<p>Any term store on any SharePoint farm can be exported with the script named <strong><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/64/42/04/ExportImportMMS.zip" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-64-42-04/ExportImportMMS.zip">ExportMMStoCSV.ps1</a></strong>.</p>
</li>
<li>
<p>Navigate to the file ensure the parameters central Admin URL and Managed Metadata services name are in par with the environment.</p>
</li>
<li>
<p>Login to admin server as farm admin</p>
</li>
<li>
<p>Open the PowerShell ISE as administrator</p>
</li>
<li>
<p>Open the <strong>ExportMMStoCSV.ps1</strong></p>
</li>
<li>
<p>Execute the script.</p>
</li>
<li>
<p>The script, upon completion generates a CSV file on the same folder where the script is located.</p>
</li>
<li>
<p>The file consists of information in the following sequence.</p>
</li>
</ul>
<table style="width: 568px;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="161">
<p><span>Field</span></p>
</td>
<td valign="top" width="251">
<p><span>Description</span></p>
</td>
<td valign="top" width="156">
<p><span>Example</span></p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>TermGroup</p>
</td>
<td valign="top" width="251">
<p>Mandatory</p>
</td>
<td valign="top" width="156">
<p>Test</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>TermSet</p>
</td>
<td valign="top" width="251">
<p>Mandatory</p>
</td>
<td valign="top" width="156">
<p>Set 1</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Term</p>
</td>
<td valign="top" width="251">
<p>Mandatory</p>
</td>
<td valign="top" width="156">
<p>Term 1</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Level2</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>Term 1.1</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Level3</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>Term 1.1.1</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Level4</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Level5</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>UpdatedTitle</p>
</td>
<td valign="top" width="251">
<p>Will not be populated during export. However required for any updates to existing title changes at any level above.</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Url</p>
</td>
<td valign="top" width="251">
<p>If available will be populated during export.</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>FriendlyUrl</p>
</td>
<td valign="top" width="251">
<p>If available will be populated during export.</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>CatalogTargetUrl</p>
</td>
<td valign="top" width="251">
<p>If available will be populated during export.</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>CatalogChildTargetUrl</p>
</td>
<td valign="top" width="251">
<p>If available will be populated during export.</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>TargetUrl</p>
</td>
<td valign="top" width="251">
<p>If available will be populated during export.</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>ChildTargetUrl</p>
</td>
<td valign="top" width="251">
<p>If available will be populated during export.</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>LastModified</p>
</td>
<td valign="top" width="251">
<p>If available will be populated during export.</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Action</p>
</td>
<td valign="top" width="251">
<p>Will be empty during export.</p>
</td>
<td valign="top" width="156">
<p>Add/Update</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Status</p>
</td>
<td valign="top" width="251">
<p>Will be empty during export</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<ul>
<li>
<p>The administrators can use Office Excel to open the CSV and perform changes.</p>
</li>
</ul>
<p><span>Adding a new Term to CMS Managed Metadata Term Set</span></p>
<p><span>A new term can be added to the term set by adding a new line to the CSV file. The following example illustrates the new term named </span><strong><span>CPF Life 1</span></strong><span> addition under the existing term </span><strong><span>Retirement</span></strong></p>
<table style="width: 568px;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="161">
<p><span>Field</span></p>
</td>
<td valign="top" width="251">
<p><span>Description</span></p>
</td>
<td valign="top" width="156">
<p><span>Example</span></p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>TermGroup</p>
</td>
<td valign="top" width="251">
<p>Mandatory</p>
</td>
<td valign="top" width="156">
<p>Test</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>TermSet</p>
</td>
<td valign="top" width="251">
<p>Mandatory</p>
</td>
<td valign="top" width="156">
<p>Set 1</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Term</p>
</td>
<td valign="top" width="251">
<p>Mandatory</p>
</td>
<td valign="top" width="156">
<p>Term 1</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Level2</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>Term 1.1</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Level3</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>Term 1.1.1</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Level4</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Level5</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>UpdatedTitle</p>
</td>
<td valign="top" width="251">
<p><strong>Not Applicable for ADD</strong></p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Url</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>FriendlyUrl</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>CatalogTargetUrl</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>CatalogChildTargetUrl</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>TargetUrl</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>ChildTargetUrl</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>LastModified</p>
</td>
<td valign="top" width="251">
<p>NA</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Action</p>
</td>
<td valign="top" width="251">
<p><strong>Required</strong></p>
</td>
<td valign="top" width="156">
<p><strong>Add</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Status</p>
</td>
<td valign="top" width="251">
<p>NA</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<ul>
<li>
<p>Every new iterm needs to be identified with the Action field as &ldquo;Add&rdquo;</p>
</li>
<li>
<p>A file can have both &ldquo;Add&rdquo; and &ldquo;Update&rdquo; items</p>
</li>
</ul>
<p><span>Updating an Existing Term to CMS Managed Metadata Term Set</span></p>
<p><span>A new term can be added to the term set by adding a new line to the CSV file. The following example illustrates updating an existing </span><strong><span>Term 1.1.1</span></strong><span> to</span><strong><span> Term 111</span></strong></p>
<table style="width: 568px;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="161">
<p><span>Field</span></p>
</td>
<td valign="top" width="251">
<p><span>Description</span></p>
</td>
<td valign="top" width="156">
<p><span>Example</span></p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>TermGroup</p>
</td>
<td valign="top" width="251">
<p>Mandatory</p>
</td>
<td valign="top" width="156">
<p>Test</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>TermSet</p>
</td>
<td valign="top" width="251">
<p>Mandatory</p>
</td>
<td valign="top" width="156">
<p>Set 1</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Term</p>
</td>
<td valign="top" width="251">
<p>Mandatory</p>
</td>
<td valign="top" width="156">
<p>Term 1</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Level2</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>Term 1.1</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Level3</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>Term 1.1.1</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Level4</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Level5</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>UpdatedTitle</p>
</td>
<td valign="top" width="251">
<p><strong>Required only for Title Update</strong></p>
<p><strong>In case of updates to the below fields value for this field is optional</strong></p>
</td>
<td valign="top" width="156">
<p><strong>Term 111</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Url</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>FriendlyUrl</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>CatalogTargetUrl</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>CatalogChildTargetUrl</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>TargetUrl</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>ChildTargetUrl</p>
</td>
<td valign="top" width="251">
<p>Optional</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>LastModified</p>
</td>
<td valign="top" width="251">
<p>NA</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Action</p>
</td>
<td valign="top" width="251">
<p><strong>Required</strong></p>
</td>
<td valign="top" width="156">
<p><strong>Update</strong></p>
</td>
</tr>
<tr>
<td valign="top" width="161">
<p>Status</p>
</td>
<td valign="top" width="251">
<p>NA</p>
</td>
<td valign="top" width="156">
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p><span>&nbsp;</span></p>
<ul>
<li>
<p>In case of updates to a parent term, only the particular row on the csv needs to be updated and name on the child terms is not required to be updated.</p>
</li>
<li>
<p>Every update needs to be identified with the Action field as &ldquo;Update&rdquo;</p>
</li>
<li>
<p>A file can have both &ldquo;Add&rdquo; and &ldquo;Update&rdquo; items</p>
</li>
</ul>
<p><span style="color: #008ac8; font-family: Segoe UI; font-size: large;">Importing SharePoint Managed Metadata</span></p>
<ul>
<li>
<p>The csv file this updated above can be imported into any termstore on any sharepoint farm with the script named <strong><a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/<strong>http:/blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-64-42-04/ExportImportMMS.zip</strong>">ImportCsvtoMMS.ps1</a></strong></p>
</li>
<li>
<p>Navigate to the file ensure the parameters central Admin Url and Managed Metadata services name are in par with the environment.</p>
</li>
<li>
<p>Login to admin server as farm admin</p>
</li>
<li>
<p>Open the powershell ISE as administrator</p>
</li>
<li>
<p>Open the <strong>ImportCsvtoMMS.ps1</strong></p>
</li>
<li>
<p>Execute the script.</p>
</li>
<li>
<p>The script, upon completion generates a CSV file on the same folder where the script is located with the status information.</p>
</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/64/42/04/ExportImportMMS.zip" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-64-42-04/ExportImportMMS.zip">ExportImportMMS.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Updating SharePoint Content Search Webpart (CSWP) Default Cache Duration</title>
      <link>https://docs.microsoft.com/archive/blogs/thirusrinivasan1/updating-sharepoint-content-search-webpart-cswp-default-cache-duration</link>
      <pubDate>Wed, 16 Sep 2015 03:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Thiru Srinivasan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/thirusrinivasan1/2015/09/16/updating-sharepoint-content-search-webpart-cswp-default-cache-duration/</guid>
      <description><![CDATA[On a search driven SharePoint site, Content Search Web Parts are configured to use the Anonymous...]]></description>
      <content:encoded><![CDATA[<p>On a search driven SharePoint site, Content Search Web Parts are configured to use the Anonymous Search Results Cache. The Anonymous Search Results Cache stores results of a query, refinement data for the query, and additional result tables that are returned from the SharePoint Distributed Cache Service. Each cache entry depends on the parameters of a query, such as the sort order of the results, the requested refiners, and any dynamic reordering rules. The cache affects all queries that a web application handles including queries from Search Web Parts and the queries from CSOM clients.</p>
<p>This cache is not used for queries that are authenticated because of security concerns.</p>
<p>By default, the Anonymous Search Results Cache refreshes items every 15 minutes. The cache duration can be changed by updating the SharePoint web application property named "SearchResultsCacheTTLinSeconds" through the PowerShell.</p>
<table border="1" cellspacing="0" cellpadding="10">
<tbody>
<tr>
<td><span style="color: #003366;">$webapp = get-spwebapplication https://www.contoso.com</span><br /><span style="color: #003366;">$webapp.Properties["SearchResultsCacheTTLinSeconds"] = &lt;number of seconds to keep in cache&gt; </span><br /><span style="color: #003366;">$webapp.Update()</span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><strong>Note</strong>:</span></p>
<p>In order to enable a Content Search or a Catalog Item Reuse Web Part for Anonymous search results cache the configuration of that Web Part must have the <em>TryCache </em>property set to <strong>true</strong>.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/2235.CSWPCache.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/2235.CSWPCache.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/2235.CSWPCache.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/2235.CSWPCache.png" alt="" border="0" /></a></p>
<p>Also ensure the<em> DataProviderJSON</em> property of the CSWP is configured with the <strong>TryCache:true</strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/6646.CSWPCacheDPJSON.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/6646.CSWPCacheDPJSON.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/6646.CSWPCacheDPJSON.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/6646.CSWPCacheDPJSON.png" alt="" border="0" /></a></p>]]></content:encoded>
    </item>
    <item>
      <title>(B)Locking system pages on SharePoint sites</title>
      <link>https://docs.microsoft.com/archive/blogs/thirusrinivasan1/blocking-system-pages-on-sharepoint-sites</link>
      <pubDate>Wed, 16 Sep 2015 02:26:00 GMT</pubDate>
      <dc:creator><![CDATA[Thiru Srinivasan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/thirusrinivasan1/2015/09/16/blocking-system-pages-on-sharepoint-sites/</guid>
      <description><![CDATA[To prevent anonymous visitors from browsing system pages on a public-facing website, SharePoint...]]></description>
      <content:encoded><![CDATA[<p>To prevent anonymous visitors from browsing system pages on a public-facing website, SharePoint offers the ViewFormPagesLockdown Feature. The hidden Feature, which is a part of the standard Publishing Site, upon activation, prevents anonymous visitors from accessing system pages. Whenever an anonymous user browses to a system page, he will be prompted to authenticate.</p>
<p>Authentication prompt displayed to an anonymous user on a public SharePoint site after browsing to a system page. On user experience perspective, prompting for credentials is not an expected behavior and any administrators would like to avoid this.</p>
<p>In addition to that, denying access to system pages would reduce the chance of the attackers from trying their chances. Though the ViewFormPagesLockdown Feature provides some prevention from form page access, its not complete. Hence there is some enhancement required to block them completely.</p>
<p>Having said that, one of the possible option is to use the IIS URL Rewrite module extension 2.0.</p>
<p><strong>About IIS URL Rewrite 2.0:</strong><br />IIS URL Rewrite 2.0 enables Web administrators to create powerful rules to implement URLs that are easier for users to remember and easier for search engines to find. By using rule templates, rewrite maps, .NET providers, and other functionality integrated into IIS Manager, Web administrators can easily set up rules to define URL rewriting behavior based on HTTP headers, HTTP response or request headers, IIS server variables, and even complex programmatic rules. In addition, Web administrators can perform redirects, send custom responses, or stop HTTP requests based on the logic expressed in the rewrite rules.</p>
<p><strong>Solution:</strong></p>
<p>IIS URL Rewrite 2.0 can be enabled to achieve the complete blocking of system pages.</p>
<p>Download and install the IIS URL Rewrite Module 2.0 from the location <a title="IIS URL Rewrite" href="http://go.microsoft.com/?linkid=9722532">http://go.microsoft.com/?linkid=9722532</a> on all SharePoint web front ends.</p>
<p>Upon installation close and reopen the IIS console to see the URL Rewrite icon every web application.</p>
<p>Open the IIS web application on which you need to block the system pages. usually this is the public anonymous sites extended on internet zone.</p>
<p>Add the following rewrite block just before the <span>&lt;/system.webServer&gt; tag. This procedure needs to be performed on all web front end servers.</span></p>
<table border="1" cellspacing="0" cellpadding="10" align="left">
<tbody>
<tr>
<td><span style="color: #003366;">&lt;rewrite&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;rules&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;clear /&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;rule name="Allow _vti_bin Client.svc" enabled="true" patternSyntax="Wildcard" stopProcessing="true"&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;match url="*" /&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;conditions logicalGrouping="MatchAny" trackAllCaptures="false"&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add input="{URL}" pattern="*/_vti_bin/client.svc*" /&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/conditions&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action type="None" /&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/rule&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;rule name="Block Admin Pages" enabled="false" patternSyntax="Wildcard" stopProcessing="true"&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;match url="*" /&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;conditions logicalGrouping="MatchAny" trackAllCaptures="false"&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add input="{URL}" pattern="*_layouts/*.aspx" /&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add input="{URL}" pattern="*_vti_bin/*" /&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/conditions&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action type="Redirect" url="{C:1}" /&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/rule&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;rule name="Block Form Pages" enabled="false" patternSyntax="Wildcard" stopProcessing="true"&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;match url="*" /&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;conditions logicalGrouping="MatchAny" trackAllCaptures="false"&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add input="{URL}" pattern="*/forms/*" /&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add input="{URL}" pattern="*/overview.aspx" /&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add input="{URL}" pattern="*/summary.aspx" /&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add input="{URL}" pattern="*/allitems.aspx" /&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/conditions&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action type="Redirect" url="http://{HTTP_HOST}" /&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/rule&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/rules&gt;</span><br /><span style="color: #003366;">&nbsp;&nbsp;&nbsp; &lt;/rewrite&gt;</span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>Adding the above block to web.config&nbsp;will recycle the app pool automatically. As a validation step try to check the web application's configuration using the configuration editor on IIS.</p>
<p>Any error on UI would reveal that there is something messed up with the web.config updates.</p>
<p>Upon successful validations, try to access the system pages for example /_layouts/settings.aspx and ensure its getting redirected to home page.</p>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint 2013 Workflow - Refresh/Push Latest Workflow Changes (Definitions)</title>
      <link>https://docs.microsoft.com/archive/blogs/thirusrinivasan1/sharepoint-2013-workflow-refreshpush-latest-workflow-changes-definitions</link>
      <pubDate>Mon, 18 Nov 2013 10:04:00 GMT</pubDate>
      <dc:creator><![CDATA[Thiru Srinivasan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/thirusrinivasan1/2013/11/18/sharepoint-2013-workflow-refreshpush-latest-workflow-changes-definitions/</guid>
      <description><![CDATA[During my tenure on last engagement, realized that pushing the latest changes on workflows in not...]]></description>
      <content:encoded><![CDATA[<p>During my tenure on last engagement, realized that pushing the latest changes on workflows in not working as expected and the latest changes are not&nbsp;effective until the sub site (web) was recreated. In my case I tried options like dissociating workflows, recreating libraries, reactivating the workflow features etc, to ensure the latest changes are pushed, with no luck. After all I identified that, upon&nbsp;deactivation of workflow definition feature, though the feature gets deactivated the&nbsp;workflow definitions continue to reside&nbsp;and not getting replaced upon reactivation of the workflow feature. The same can be validated by navigating to the <strong>Root Folder&nbsp;-&gt; wfsvc</strong> using SharePoint Manger 2013. This is intentionally made, not to disturb any existing workflows or running instances.</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/52611.1.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/52611.1.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/52611.1.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/359x577/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/52611.1.jpg" alt="" border="0" /></a></p>
<p>Hence I realized the real need of&nbsp;workaround for addressing this issue and identified one. The idea is remove the work definitions programmatically to ensure the corresponding files are wiped off from the web. Make sure the following code is integrated to remove the workflow definitions from the given web.</p>
<pre class="scroll"><code class="csharp">/// &lt;summary&gt;<br />/// Removes the workflow definitions.<br />/// &lt;/summary&gt;<br />/// &lt;param name="web"&gt;The web.&lt;/param&gt;<br />/// &lt;param name="workflowDefinitionIds"&gt;The workflow definition ids.&lt;/param&gt;<br />public static void RemoveWorkflowDefinitions(SPWeb web, List&lt;Guid&gt; workflowDefinitionIds)<br />{<br /> var workflowServicesManager = new WorkflowServicesManager(web);<br /> <br /> if (!workflowServicesManager.IsConnected)<br /> {<br /> var notConnectedEx = new NotConnectedException();<br /> Logger.LogCriticalException(notConnectedEx, ErrorCategory.CommonOperation);<br /> throw notConnectedEx;<br /> }<br /> <br /> var workflowDeploymentService = workflowServicesManager.GetWorkflowDeploymentService();<br /> <br /> foreach (var workflowDefinitionId in workflowDefinitionIds)<br /> {<br /> var workflowDefinition = workflowDeploymentService.GetDefinition(workflowDefinitionId);<br /> <br /> if (workflowDefinition != null)<br /> {<br /> workflowDeploymentService.DeleteDefinition(workflowDefinitionId);<br /> }<br /> }<br />}</code></pre>
<p>And now we can call the method to remove the definitions with specific IDs as follows.</p>
<pre class="scroll"><code class="csharp">RemoveWorkflowDefinitions(web, new List&lt;Guid&gt; { new Guid("D7CA92FA-1220-4959-A806-719CBDE3DB6D") });</code></pre>
<p><span style="text-decoration: underline;"><strong>Note</strong></span>: <strong>Before deletion of any WF definition by calling the above line,&nbsp;Please make sure that all the workflow instances of the given workflow definition is removed/disassociated from the list/libraries .</strong></p>
<p>Upon successful call to this method, you can validate and find that the workflow defintions are removed from the web <strong>Root Folder&nbsp;-&gt; wfsvc</strong>.</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/6685.2.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/6685.2.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/6685.2.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/260x563/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/6685.2.jpg" alt="" border="0" /></a></p>
<p>Upon this, you&nbsp;&nbsp;are good to go and activate the workflow definition feature that restores the updated (changed)&nbsp;version of the workflow on given site.</p>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint 2013 Workflow - Calling a WCF Service</title>
      <link>https://docs.microsoft.com/archive/blogs/thirusrinivasan1/sharepoint-2013-workflow-calling-a-wcf-service</link>
      <pubDate>Thu, 31 Oct 2013 10:01:00 GMT</pubDate>
      <dc:creator><![CDATA[Thiru Srinivasan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/thirusrinivasan1/2013/10/31/sharepoint-2013-workflow-calling-a-wcf-service/</guid>
      <description><![CDATA[In SharePoint 2013 workflows, since its been re-architectured and CSOM based, the need of making Web...]]></description>
      <content:encoded><![CDATA[<p>In SharePoint 2013 workflows, since its been re-architectured and CSOM based, the need of making Web or WCF service calls are more and we may need to deal with data and operation contracts (complex types).&nbsp;Hence thought of sharing samples&nbsp;that might help you in your&nbsp;implementations.</p>
<h3>Sample Schema</h3>
<p>The following is the schema of a sample WCF service that provides an Operation (Ensure Users) that can accept <strong>EnsureUserRequestReponse</strong> (<strong>Data Contract - Dynamic Value</strong>) as input and responds thru the same contract. The <strong>EnsureUserRequestReponse </strong>contract in turn&nbsp;has collection of users&nbsp;<strong>(Dynamic Value - Collection of Dynamic Values).</strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/7433.ServiceClass.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/7433.ServiceClass.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/7433.ServiceClass.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/7433.ServiceClass.jpg" alt="" border="0" /></a></p>
<h3>Building a Data Contract - Dynamic Value</h3>
<p>With the help of Dynamic Value (<strong>User</strong>)&nbsp;and a Dynamic value collection (<strong>UserList</strong>), we need to&nbsp;construct another Dynamic Value (<strong>EnsureUserRequest</strong>), to represent the <strong>Data Contact.</strong></p>
<p><strong>For detailed steps on building a dynamic value and dynamic value collection, please refer to my other blog <a href="http://blogs.msdn.com/b/thirusrinivasan1/archive/2013/10/26/sharepoint-2013-workflow-handling-dynamic-values-and-collections.aspx">Handling Dynamic Values.</a></strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/7776.Dynamic_Contract.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/7776.Dynamic_5F00_Contract.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/7776.Dynamic_Contract.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/7776.Dynamic_5F00_Contract.jpg" alt="" border="0" /></a></p>
<h3>Making a WCF Service Call</h3>
<p>Upon construction of data contract dynamic value, its time to make the WCF call. Drag drop a HTTPSend Activity and configure the following 4 properties.</p>
<table>
<tbody>
<tr>
<td>
<p>Method</p>
</td>
<td>
<p>POST</p>
</td>
</tr>
<tr>
<td>
<p>RequestContent</p>
</td>
<td>
<p><strong>EnsureUserRequest</strong> (Dynamic Value)</p>
</td>
</tr>
<tr>
<td>
<p>URL</p>
</td>
<td>
<p>WCF Service URL</p>
</td>
</tr>
<tr>
<td>
<p>ResponseContent</p>
</td>
<td>
<p><strong>EnsureUserResponse</strong> (Dynamic Value)</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;Upon completion, the activity might look similar to the following.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/1781.WCF_Request.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/1781.WCF_5F00_Request.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/1781.WCF_Request.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/1781.WCF_5F00_Request.jpg" alt="" border="0" /></a></p>
<h3>Retrieving WCF Response (using GetDynamicValueProperties<strong>)</strong></h3>
<p>The response (EnsureUserRequestResponse) from the WCF call will be stored to the&nbsp;dynamic variable (<strong>EnsureUserResponse</strong>)&nbsp;and can be retrieved thru <strong>GetDynamicValueProperties</strong> Activity.</p>
<p>Drag drop the <strong>GetDynamicValueProperties </strong>activity&nbsp;and&nbsp;configure the source as&nbsp;<strong>EnsureUserResponse.</strong></p>
<p>Configure the Properties to be retrieved from the Dynamic value. In this case its Users (<strong>LHS</strong> - <strong>Name of the property on WCF service data contract)</strong> and <strong>EnsuredUserList</strong> (RHS - Local Dynamic variable)</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/4062.GetDynamicValueProps_Activity.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/4062.GetDynamicValueProps_5F00_Activity.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/4062.GetDynamicValueProps_Activity.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/4062.GetDynamicValueProps_5F00_Activity.jpg" alt="" border="0" /></a></p>
<h3>Looping Thru Response Collection (Dynamic Value collection)</h3>
<p>Can use a <strong>ForEach</strong> activity to loop thru the Dynamic Value collection (<strong>EnsuredUserList</strong>)&nbsp;and <strong>GetDynamicValueProperties</strong> activity again to read thru each Dynamic Value (<strong>Item</strong>) and get properties.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/4454.GetDynamicValueProps_Activity_Collection_Loop.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/4454.GetDynamicValueProps_5F00_Activity_5F00_Collection_5F00_Loop.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/4454.GetDynamicValueProps_Activity_Collection_Loop.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/4454.GetDynamicValueProps_5F00_Activity_5F00_Collection_5F00_Loop.jpg" alt="" border="0" /></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/6406.GetDynamicValueProps_Activity_Collection_Loop.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/6406.GetDynamicValueProps_5F00_Activity_5F00_Collection_5F00_Loop.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/6406.GetDynamicValueProps_Activity_Collection_Loop.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/6406.GetDynamicValueProps_5F00_Activity_5F00_Collection_5F00_Loop.jpg" alt="" border="0" /></a></p>
<p>In case of nested dynamic values, we need to use <strong>GetDynamicValueProperties </strong>as well in the loop&nbsp;to retrieve the dynamic value at different levels.</p>
<p>Hope this helps you in&nbsp;making WCF service calls from SharePoint 2013 workflows.</p>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint 2013 Workflow Development - Handling Dynamic Values and Collections</title>
      <link>https://docs.microsoft.com/archive/blogs/thirusrinivasan1/sharepoint-2013-workflow-development-handling-dynamic-values-and-collections</link>
      <pubDate>Fri, 25 Oct 2013 12:04:00 GMT</pubDate>
      <dc:creator><![CDATA[Thiru Srinivasan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/thirusrinivasan1/2013/10/25/sharepoint-2013-workflow-development-handling-dynamic-values-and-collections/</guid>
      <description><![CDATA[SharePoint 2013 Workflow provides a&nbsp;new data type called DynamicValue. This new data type, in...]]></description>
      <content:encoded><![CDATA[<p>SharePoint 2013 Workflow provides a&nbsp;new data type called DynamicValue. This new data type, in combination with the other workflow activities, makes our life&nbsp;much easier to work with services in SharePoint 2013 workflows. This&nbsp;data type would be very helpful in handling class objects, data contracts, operation contracts etc., during service calls. Basically it understands JSON. Hence when we make&nbsp;WCF service calls with an HTTP activity, the data/operation contract returned by the service on JSON format will be transformed into&nbsp;an object of type DynamicValue. we will be&nbsp;then use another activity to pull data out of this variables of this data type using an XPATH like notation.</p>
<h3>Creating&nbsp;a Dynamic Variable&nbsp;</h3>
<p>As a first step before using the dynamic types, we need create a dynamic variable to hold the dynamic values.</p>
<p>For creating a dynamic value variable, go to variables tab on the workflow and create a new variable.</p>
<p>By default the <strong>"Microsoft.Activities.DynamicValue"</strong> wont be appearing, in such cases select option <strong>"Browse for Types..."</strong> from the Variable type drop down.</p>
<p style="padding-left: 30px;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/5621.Dynamic_var.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/5621.Dynamic_5F00_var.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/5621.Dynamic_var.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/5621.Dynamic_5F00_var.jpg" alt="" border="0" /></a></p>
<p>Selecting option <strong>"Browse for Types..."</strong> from the Variable type drop down, opens a new dialog to select the type. Typing in first few characters will bring you the types that start with those characters.</p>
<p>Select <strong>"Dynamic Value"</strong> from <strong>Microsoft.Activities</strong> group.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/2313.Dynamic.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/2313.Dynamic.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/2313.Dynamic.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/2313.Dynamic.jpg" alt="" border="0" /></a></p>
<h3>Creating&nbsp;a Dynamic Value</h3>
<p>When the dynamic variable is created to store the dynamic value, drag drop the "<strong>BuildDynamicValue</strong>" activity from the tool box to the workflow.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/6330.DynamicValueActivity.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/6330.DynamicValueActivity.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/6330.DynamicValueActivity.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/6330.DynamicValueActivity.jpg" alt="" border="0" /></a></p>
<p>Click on <strong>View Properties</strong> and start mapping your local variables (RHS) to the service's data (or) operator&nbsp;contract properties (LHS)</p>
<p>In this case <strong>UPN</strong> (string), <strong>Email</strong> (string) and <strong>DisplayName</strong> (String) are mapped to corresponding contract properties.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/1033.DynamicValue_Attribs.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/1033.DynamicValue_5F00_Attribs.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/1033.DynamicValue_Attribs.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/1033.DynamicValue_5F00_Attribs.jpg" alt="" border="0" /></a></p>
<p>Make sure you create the local variables with respective data types as per the contract.</p>
<p>In case of complex types, the dynamic value will in turn&nbsp;hold another dynamic value, till the value reaches to simple types. By other terms, its the process of breaking&nbsp;complex types in to simple types.</p>
<p><strong>For Example:</strong></p>
<ul>
<li><span style="color: #ff0000;"><strong>User (Complex Type - Dynamic Value)</strong></span></li>
<ul>
<li>UPN (Simple Type - string)</li>
<li>Email Id (Simple Type - string)</li>
<li>Display Name (Simple Type - string)</li>
<li><span style="color: #ff0000;"><strong>Group (Complex Type - Dynamic Value)</strong></span></li>
<ul>
<li>Name (Simple - string)</li>
<li>Id (Simple - string)</li>
</ul>
</ul>
</ul>
<h3>Creating a Dynamic Value Collection</h3>
<p>In order to create a dynamic value collection, we need to first create a variable.</p>
<p>By default the collection variable wont be available for selection and we need to browse thru the types.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/7318.Dynamic_Coll_Var.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/7318.Dynamic_5F00_Coll_5F00_Var.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/7318.Dynamic_Coll_Var.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/7318.Dynamic_5F00_Coll_5F00_Var.jpg" alt="" border="0" /></a></p>
<p>Search for "<strong>collection"</strong> and select the <strong>"System.Collections.ObjectModel.Collection&lt;T&gt;, </strong>Upon selection, the dialog box provides an option to select the collection type. You have to select <strong>"DynamicValue</strong>" here. In case if its not listed, browse for types from the drop down, search and select the <strong>"Dynamic Value".</strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/1638.Dynamic_Coll_Var1.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/1638.Dynamic_5F00_Coll_5F00_Var1.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/1638.Dynamic_Coll_Var1.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/1638.Dynamic_5F00_Coll_5F00_Var1.jpg" alt="" border="0" /></a></p>
<h3>Building a Collection</h3>
<p>For Building a collection of any type we can use the <strong>BuildCollection&lt;T&gt;</strong> Activity.</p>
<p>Upon adding this activity to workflow, it does open a dialog box where we need to select the content type for &lt;T&gt;. Need to select <strong>DynamicValue</strong> as type here.</p>
<p>The type selection here would be tricky here, as&nbsp;there is no option to change the type once selected.&nbsp;VS2012&nbsp;property explorer&nbsp;will not provide any option to change the type.</p>
<p>The option is to either delete and recreate the activity with right data type or change the type in XAML file, which might be tricky and leads to unexpected results, when workflow is accidentally messed up. Really needs some hands on experience before you can try that.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/7268.Dynamic_Coll_Var2.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/7268.Dynamic_5F00_Coll_5F00_Var2.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/7268.Dynamic_Coll_Var2.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/7268.Dynamic_5F00_Coll_5F00_Var2.jpg" alt="" border="0" /></a></p>
<p>Once the activity is dropped and the type is set to "Dynamic Value", we can associate the collection variable defined on the previous step. (UserList)</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/1513.Dynamic_Coll_Activity.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/1513.Dynamic_5F00_Coll_5F00_Activity.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/1513.Dynamic_Coll_Activity.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/1513.Dynamic_5F00_Coll_5F00_Activity.jpg" alt="" border="0" /></a></p>
<h3>Building a Dynamic Value</h3>
<p>Upon creation of all required variables and setting up activities, its time to build a dynamic value.</p>
<p>Include the logic to pull the values for different variables required for the dynamic value. In this case its UPN, Email and DisplayName.</p>
<p>Drag and drop a BuildDynamicValue activity and assign the result as dynamic variable defined. in this case its <strong>User</strong>.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/1581.DynamicValueActivity.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/1581.DynamicValueActivity.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/1581.DynamicValueActivity.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/1581.DynamicValueActivity.jpg" alt="" border="0" /></a></p>
<p>Click on view properties and start assigning properties.</p>
<p>While assigning properties, make sure the local properties on RHS are of similar&nbsp;type as the ones on the LHS (i.e the Data contract properties)</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/8105.DynamicValue_Attribs.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/8105.DynamicValue_5F00_Attribs.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/8105.DynamicValue_Attribs.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/8105.DynamicValue_5F00_Attribs.jpg" alt="" border="0" /></a></p>
<p><span style="text-decoration: underline;"><strong>Important Note</strong>:</span> The LHS types would be&nbsp;derived dynamically based on the&nbsp;types of variables assigned on RHS. In case of misconfiguration, the LHS types wont be automatically corrected upon associating another variable of different type. This&nbsp;would&nbsp;throw a&nbsp;type mismatch error during&nbsp;compilation. This needs to be corrected manually on XML, which would be risky,&nbsp;Hence the recommendation here is to delete the assignment line item in subject and&nbsp;create a new one.</p>
<h3>Add Dynamic Value to Collection</h3>
<p>Upon construction of a Dynamic value the same can be added to a collection.</p>
<p>Drag and drop a AssignToCollection&lt;T&gt; activity and update relevant properties.</p>
<p>This activity must have the Collections property associated with the Dynamic Value Collection variable (UserList), type selected as Dynamic Value and the Item to be added (User).</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/5810.Dynamic_Coll_Activity1.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/5810.Dynamic_5F00_Coll_5F00_Activity1.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/5810.Dynamic_Coll_Activity1.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/5810.Dynamic_5F00_Coll_5F00_Activity1.jpg" alt="" border="0" /></a></p>
<h2>Calling a WCF Service</h2>
<p>The following is the schema of a sample WCF service that provides an Operation (Ensure Users) that can accept <strong>EnsureUserRequestReponse</strong> (<strong>Data Contract - Dynamic Value</strong>) as input and responds thru the same contract. The <strong>EnsureUserRequestReponse </strong>contract in turn&nbsp;has collection of users&nbsp;<strong>(Dynamic Value - Collection of Dynamic Values).</strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/7433.ServiceClass.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/7433.ServiceClass.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/7433.ServiceClass.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/7433.ServiceClass.jpg" alt="" border="0" /></a></p>
<h3>Building a Data Contract - Dynamic Value</h3>
<p>With the help of Dynamic Value (<strong>User</strong>)&nbsp;and a Dynamic value collection (<strong>UserList</strong>) &nbsp;built in above steps, we need to&nbsp;construct another Dynamic Value (<strong>EnsureUserRequest</strong>), to represent the <strong>Data Contact.</strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/7776.Dynamic_Contract.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/7776.Dynamic_5F00_Contract.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/7776.Dynamic_Contract.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/7776.Dynamic_5F00_Contract.jpg" alt="" border="0" /></a></p>
<h3>Making a WCF Service Call</h3>
<p>Upon construction of data contract dynamic value, its time to make the WCF call. Drag drop a HTTPSend Activity and configure the following 4 properties.</p>
<table>
<tbody>
<tr>
<td>
<p>Method</p>
</td>
<td>
<p>POST</p>
</td>
</tr>
<tr>
<td>
<p>RequestContent</p>
</td>
<td>
<p><strong>EnsureUserRequest</strong> (Dynamic Value)</p>
</td>
</tr>
<tr>
<td>
<p>URL</p>
</td>
<td>
<p>WCF Service URL</p>
</td>
</tr>
<tr>
<td>
<p>ResponseContent</p>
</td>
<td>
<p><strong>EnsureUserResponse</strong> (Dynamic Value)</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;Upon completion, the activity might look similar to the following.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/1781.WCF_Request.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/1781.WCF_5F00_Request.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/1781.WCF_Request.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/1781.WCF_5F00_Request.jpg" alt="" border="0" /></a></p>
<h3>Retrieving WCF Response (using GetDynamicValueProperties<strong>)</strong></h3>
<p>The response (EnsureUserRequestResponse) from the WCF call will be stored to the&nbsp;dynamic variable (<strong>EnsureUserResponse</strong>)&nbsp;and can be retrieved thru <strong>GetDynamicValueProperties</strong> Activity.</p>
<p>Drag drop the <strong>GetDynamicValueProperties </strong>activity&nbsp;and&nbsp;configure the source as&nbsp;<strong>EnsureUserResponse.</strong></p>
<p>Configure the Properties to be retrieved from the Dynamic value. In this case its Users (<strong>LHS</strong> - <strong>Name of the property on WCF service data contract)</strong> and <strong>EnsuredUserList</strong> (RHS - Local Dynamic variable)</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/4062.GetDynamicValueProps_Activity.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/4062.GetDynamicValueProps_5F00_Activity.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/4062.GetDynamicValueProps_Activity.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/4062.GetDynamicValueProps_5F00_Activity.jpg" alt="" border="0" /></a></p>
<h3>Looping Thru Response Collection (Dynamic Value collection)</h3>
<p>Can use a <strong>ForEach</strong> activity to loop thru the Dynamic Value collection (<strong>EnsuredUserList</strong>)&nbsp;and <strong>GetDynamicValueProperties</strong> activity again to read thru each Dynamic Value (<strong>Item</strong>) and get properties.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/4454.GetDynamicValueProps_Activity_Collection_Loop.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/4454.GetDynamicValueProps_5F00_Activity_5F00_Collection_5F00_Loop.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/4454.GetDynamicValueProps_Activity_Collection_Loop.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/4454.GetDynamicValueProps_5F00_Activity_5F00_Collection_5F00_Loop.jpg" alt="" border="0" /></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/6406.GetDynamicValueProps_Activity_Collection_Loop.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/6406.GetDynamicValueProps_5F00_Activity_5F00_Collection_5F00_Loop.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/6406.GetDynamicValueProps_Activity_Collection_Loop.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/6406.GetDynamicValueProps_5F00_Activity_5F00_Collection_5F00_Loop.jpg" alt="" border="0" /></a></p>
<p>In case of nested dynamic values, we need to use <strong>GetDynamicValueProperties </strong>as well in the loop&nbsp;to retrieve the dynamic value at different levels.</p>
<p>Hope this helps you in playing around the dynamic values, collections and making WCF service calls from SharePoint 2013 workflows.</p>
<div id="r1PostCPBlock" style="border: currentColor; left: -99999px; text-align: left; color: #000000; overflow: hidden; text-decoration: none; position: absolute; background-color: #ffffff; border-image: none;">This is a new data type in WAW. There's a more technical and complicated explanation to this data type but I think it's easier to understand in the context of how it's used. Basically it understands JSON. So when you call a WCF service with an HTTP activity, it returns an object of type DynamicValue. You then use another activity to pull data out of this variables of this data type using an XPATH like notation. I'll show how to use this in the next post. I'm a HUGE fan of this!<br /><span>Read more at <a style="color: #003399;" href="http://www.andrewconnell.com/blog/SP2013Whats-new-with-Workflow#hBsPYppRqZkh4OkL.99">http://www.andrewconnell.com/blog/SP2013Whats-new-with-Workflow#hBsPYppRqZkh4OkL.99</a></span></div>
<div id="r1PostCPBlock" style="border: currentColor; left: -99999px; text-align: left; color: #000000; overflow: hidden; text-decoration: none; position: absolute; background-color: #ffffff; border-image: none;">This is a new data type in WAW. There's a more technical and complicated explanation to this data type but I think it's easier to understand in the context of how it's used. Basically it understands JSON. So when you call a WCF service with an HTTP activity, it returns an object of type DynamicValue. You then use another activity to pull data out of this variables of this data type using an XPATH like notation. I'll show how to use this in the next post. I'm a HUGE fan of this!<br /><span>Read more at <a style="color: #003399;" href="http://www.andrewconnell.com/blog/SP2013Whats-new-with-Workflow#hBsPYppRqZkh4OkL.99">http://www.andrewconnell.com/blog/SP2013Whats-new-with-Workflow#hBsPYppRqZkh4OkL.99</a></span></div>
<div id="r1PostCPBlock" style="border: currentColor; left: -99999px; text-align: left; color: #000000; overflow: hidden; text-decoration: none; position: absolute; background-color: #ffffff; border-image: none;">This is a new data type in WAW. There's a more technical and complicated explanation to this data type but I think it's easier to understand in the context of how it's used. Basically it understands JSON. So when you call a WCF service with an HTTP activity, it returns an object of type DynamicValue. You then use another activity to pull data out of this variables of this data type using an XPATH like notation. I'll show how to use this in the next post. I'm a HUGE fan of this!<br /><span>Read more at <a style="color: #003399;" href="http://www.andrewconnell.com/blog/SP2013Whats-new-with-Workflow#hBsPYppRqZkh4OkL.99">http://www.andrewconnell.com/blog/SP2013Whats-new-with-Workflow#hBsPYppRqZkh4OkL.99</a></span></div>
<div id="r1PostCPBlock" style="border: currentColor; left: -99999px; text-align: left; color: #000000; overflow: hidden; text-decoration: none; position: absolute; background-color: #ffffff; border-image: none;">I mentioned this new data type called <strong>DynamicValue</strong>. This new data type, in combination with the new HTTP activities, makes it so much easier to work with services in SharePoint 2013 workflows. What Microsoft has given us are a few new activities that you use to acquire, create and parse these data types. Here's a high-level how it works:<br /><span>Read more at <a style="color: #003399;" href="http://www.andrewconnell.com/blog/SP2013-Workflow-Dynamic-Values#I7RxHqjdwxBjOob2.99">http://www.andrewconnell.com/blog/SP2013-Workflow-Dynamic-Values#I7RxHqjdwxBjOob2.99</a></span></div>
<div id="r1PostCPBlock" style="border: currentColor; left: -99999px; text-align: left; color: #000000; overflow: hidden; text-decoration: none; position: absolute; background-color: #ffffff; border-image: none;">I mentioned this new data type called <strong>DynamicValue</strong>. This new data type, in combination with the new HTTP activities, makes it so much easier to work with services in SharePoint 2013 workflows. What Microsoft has given us are a few new activities that you use to acquire, create and parse these data types. Here's a high-level how it works:<br /><span>Read more at <a style="color: #003399;" href="http://www.andrewconnell.com/blog/SP2013-Workflow-Dynamic-Values#I7RxHqjdwxBjOob2.99">http://www.andrewconnell.com/blog/SP2013-Workflow-Dynamic-Values#I7RxHqjdwxBjOob2.99</a></span></div>
<div id="r1PostCPBlock" style="border: currentColor; left: -99999px; text-align: left; color: #000000; overflow: hidden; text-decoration: none; position: absolute; background-color: #ffffff; border-image: none;"><a href="http://www.andrewconnell.com/blog/SP2013Whats-new-with-Workflow">In my last post about workflow in SharePoint 2013</a>, I mentioned this new data type called <strong>DynamicValue</strong>. This new data type, in combination with the new HTTP activities, makes it so much easier to work with services in SharePoint 2013 workflows. What Microsoft has given us are a few new activities that you use to acquire, create and parse these data types. Here's a high-level how it works:<br /><span>Read more at <a style="color: #003399;" href="http://www.andrewconnell.com/blog/SP2013-Workflow-Dynamic-Values#I7RxHqjdwxBjOob2.99">http://www.andrewconnell.com/blog/SP2013-Workflow-Dynamic-Values#I7RxHqjdwxBjOob2.99</a></span></div>]]></content:encoded>
    </item>
    <item>
      <title>Managing SharePoint Rendering on Mobile Browsers (iDevices)</title>
      <link>https://docs.microsoft.com/archive/blogs/thirusrinivasan1/managing-sharepoint-rendering-on-mobile-browsers-idevices</link>
      <pubDate>Fri, 25 Oct 2013 09:56:00 GMT</pubDate>
      <dc:creator><![CDATA[Thiru Srinivasan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/thirusrinivasan1/2013/10/25/managing-sharepoint-rendering-on-mobile-browsers-idevices/</guid>
      <description><![CDATA[Mobile browsers like Safari or Chrome render pages in a virtual "window" (the viewport), usually...]]></description>
      <content:encoded><![CDATA[<p>Mobile browsers like Safari or Chrome render pages in a virtual "window" (the viewport), usually wider than the screen, so they don't need to squeeze every page layout into a tiny window (which would break many non-mobile-optimized sites). Users can pan and zoom to see different areas of the page.</p>
<p>Mobile Safari introduced the "viewport meta tag" to let web developers control the viewport's size and scale. Many other mobile browsers now support this tag, although it is not part of any web standard. Apple's <a class="external" href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html#//apple_ref/doc/uid/TP40006509-SW29">documentation</a> does a good job explaining how web developers can use this tag, however I&nbsp;had to do some detective work to figure out exactly how to implement it in a SharePoint site with a&nbsp;custom&nbsp;fixed screen resolution. (Width 1024).</p>
<h2>Viewport basics</h2>
<p>A typical mobile-optimized site contains something like the following:</p>
<pre class="scroll"><code class="html">&lt;meta name="viewport" content="width=device-width, user-scalable=true;"&gt;</code></pre>
<p>The <code>width</code> property controls the size of the viewport. It can be set to a specific number of pixels like <code>width=600</code> or to the special value <code>device-width</code> value which is the width of the screen in CSS pixels at a scale of 100%. (There are corresponding <code>height</code> and <code>device-height</code> values, which may be useful for pages with elements that change size or position based on the viewport height.)</p>
<p>The <code>initial-scale</code> property controls the zoom level when the page is first loaded. The <code>maximum-scale</code>, <code>minimum-scale</code>, and <code>user-scalable</code> properties control how users are allowed to zoom the page in or out.</p>
<h2>Need</h2>
<p>In our SharePoint project we got&nbsp;the following very specific requirements&nbsp;with respect to mobility.</p>
<ol>
<li>Custom Branding with a of fixed screen width of 1024 pixels</li>
<li>SharePoint Mobile View Turned Off.</li>
<li>Mobility support&nbsp;to enable scroll and pinch &amp; zoom.</li>
</ol>
<p>Per the given&nbsp;specs the actual page looks like the following with a fixed width of 1024 pixels.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/3060.ActualPage.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/3060.ActualPage.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/3060.ActualPage.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/3060.ActualPage.jpg" alt="" border="0" /></a></p>
<h2>Issues and Findings</h2>
<p>Hence we tried with a recommended meta viewport setting of</p>
<pre class="scroll"><code class="html">&lt;meta name="viewport" content="user-scalable=yes, <span style="background-color: #ffff00;">width=device-width</span>, initial-scale=1.0, maximum-scale=5.0, minimum-scale=0.25"/&gt;</code></pre>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><strong>iPad Landscape Mode:</strong></span> The right side of the page is cut off and there is no scroll bar.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/6763.Ipad_Landscape.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/6763.Ipad_5F00_Landscape.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/6763.Ipad_Landscape.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/6763.Ipad_5F00_Landscape.jpg" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><strong>iPad Portrait Mode:</strong></span> The right side of the page is cut off and there is no scroll bar.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/8535.IpadPortrait.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/8535.IpadPortrait.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/8535.IpadPortrait.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/8535.IpadPortrait.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><strong>iPhone/iPod Landscape mode</strong></span>: The right side of the page is cut off and there is no scroll bar.&nbsp;</p>
<p><strong><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/3583.phone_landscape.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/3583.phone_5F00_landscape.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/3583.phone_landscape.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/3583.phone_5F00_landscape.jpg" alt="" border="0" /></a></strong></p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><strong>iPhone/iPod Portrait Mode</strong></span>: The right side of the page is cut off and there is no scroll bar.&nbsp;</p>
<p><strong><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/8611.Phone_Portrait.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/8611.Phone_5F00_Portrait.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/8611.Phone_Portrait.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/8611.Phone_5F00_Portrait.jpg" alt="" border="0" /></a></strong></p>
<p>&nbsp;</p>
<p><span style="background-color: #ffffff;"><strong>Despite setting the <span id="the-code"><span style="color: #ff0000;">user-scalable=true</span></span>&nbsp;the pinch and zoom was not functional either, due to the setting <span style="color: #ff0000;">content="width=device-width"</span></strong></span></p>
<h2><span style="font-size: medium; background-color: #ffffff;">Fix</span></h2>
<p>After a bit of play around, identified that with the following setting the issues are getting resolved and the pages are rendering fine with scroll bar, pinch &amp; Zoom options etc,.</p>
<pre class="scroll"><code class="html">&lt;meta name="viewport" content="user-scalable=yes, <span style="background-color: #ffff00;">width=1024</span>, initial-scale=1.0, maximum-scale=5.0, minimum-scale=0.25"/&gt;</code></pre>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><strong>IPad Landscape Mode: Renders full page and allows Pinch &amp; zoom</strong></span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/4857.ActualPage.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/4857.ActualPage.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/4857.ActualPage.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/4857.ActualPage.jpg" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><strong>IPad Portrait Mode: Scrolls to the right&nbsp;and allows Pinch &amp; zoom</strong></span></p>
<p><span style="text-decoration: underline;"><strong><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/2262.Ipad_Portrait_fixed.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/2262.Ipad_5F00_Portrait_5F00_fixed.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/2262.Ipad_Portrait_fixed.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/2262.Ipad_5F00_Portrait_5F00_fixed.jpg" alt="" border="0" /></a></strong></span></p>
<p>&nbsp;</p>
<p>Hence the&nbsp;recommendation is to&nbsp;use the <strong>Width</strong> attribute to control the rendering contents, specifically for the pages with custom branding and Mobile view turned off.</p>
<pre class="scroll"><code class="html"> &lt;meta name="viewport" content="user-scalable=yes, <span style="background-color: #ffff00;">width=1024</span>, initial-scale=1.0, maximum-scale=5.0, minimum-scale=0.25"/&gt;<br /> </code></pre>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint 2013 Workflow - Integrating a Custom Association Form</title>
      <link>https://docs.microsoft.com/archive/blogs/thirusrinivasan1/sharepoint-2013-workflow-integrating-a-custom-association-form</link>
      <pubDate>Tue, 24 Sep 2013 12:56:00 GMT</pubDate>
      <dc:creator><![CDATA[Thiru Srinivasan]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/thirusrinivasan1/2013/09/24/sharepoint-2013-workflow-integrating-a-custom-association-form/</guid>
      <description><![CDATA[Overview
In SharePoint 2013, the integration of custom forms like Association form,&nbsp;initiation...]]></description>
      <content:encoded><![CDATA[<h3><span style="font-family: verdana,geneva;">Overview</span></h3>
<div><span style="font-family: verdana,geneva;">In SharePoint 2013, the integration of custom forms like Association form,&nbsp;initiation form &nbsp;etc, is different from the way we do it in SharePoint 2010. In 2010 we can use either a InfoPath or ASPX pages. however in SharePoint 2013, per the know issues <a title="Office known Issues" href="http://office.microsoft.com/en-us/help/sharepoint-server-2013-known-issues-HA102919021.aspx" target="_blank">article</a>, there are no more InfoPath based workflow forms. For the workflow based on SharePoint Designer 2013 and Windows Azure Workflow, SharePoint Designer creates ASPX forms instead of InfoPath forms that were created by SharePoint 2010 workflows. If you want to customize the form, you can click it from the forms slab in workflow summary page to show a generic ASPX page editor</span></div>
<div>&nbsp;</div>
<div><span style="font-family: verdana,geneva;">Visual Studio 2012 also provides a rich set of capabilities to create Association and Initiation forms.</span></div>
<div>&nbsp;</div>
<div><span style="font-family: verdana,geneva;">The following are the&nbsp;very important capabilities/features added to SharePoint workflow while&nbsp;creating custom workflows using Visual Studio 2012.</span></div>
<ol>
<li><span style="font-family: verdana,geneva;">SharePoint 2013 introduced a rich set of client-side object mode (CSOM) based workflow API that's can be fully leveraged in VS2012</span></li>
<li><span style="font-family: verdana,geneva;">VS2012 Provides a standard Workflow Association and Initiation form templates (ASP.Net form based)&nbsp;out of the box (When SharePoint 2013 templates are installed)</span></li>
</ol>
<div><span style="font-family: verdana,geneva;">In this article we will be covering the complete set of steps involved in creating a custom workflow form and associating it to the workflow.</span></div>
<h3><span style="font-family: verdana,geneva;">Understanding the need of Association Form:</span></h3>
<div><span style="font-family: verdana,geneva;">Association and initialization forms are displayed for users to fill out before any workflow is actually started. You can use these forms to enable users to set parameters and other information for the workflow before it starts. In case if there are no custom properties/parameters needs to be associated with the workflow, the association form is not mandatory.</span></div>
<h3><span style="font-family: verdana,geneva;">Preparing workflows to be accessed from association forms</span></h3>
<div><span style="font-family: verdana,geneva;">In order to pass a parameter/property from the association form to&nbsp;the workflow, the workflow must implement/use an activity called GetConfigurationValue, which is capable/responsible for retrieving the value passed as an association data.</span></div>
<div><span style="font-family: verdana,geneva;">The activity <strong>GetConfigurationValue </strong>can be located on Runtime group of workflow activities tool box<strong>.</strong></span></div>
<div>&nbsp;</div>
<div><span style="font-family: verdana,geneva;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/8765.GetConfigurationValue.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/8765.GetConfigurationValue.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/8765.GetConfigurationValue.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/8765.GetConfigurationValue.jpg" alt="" width="224" height="163" border="0" /></a></span></div>
<div>&nbsp;</div>
<div><span style="font-family: verdana,geneva;">Upon adding the activity to the workflow, associate the activity with a variable declared at the workflow level.</span></div>
<div>&nbsp;</div>
<div><span style="font-family: verdana,geneva;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/2577.GetConfigurationValue1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/2577.GetConfigurationValue1.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/2577.GetConfigurationValue1.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/2577.GetConfigurationValue1.png" alt="" border="0" /></a></span></div>
<div>&nbsp;</div>
<div><span style="font-family: verdana,geneva;">You can create as many parameters as required in the same way with appropriate GetConfigurationValue Activity associated with a&nbsp;valid string variable in the workflow.</span></div>
<div>&nbsp;</div>
<div><span style="font-family: verdana,geneva;">Upon completion of this change, we are good to go-ahead and add the association form and make necessary changes.</span></div>
<h3><span style="font-family: verdana,geneva;">Adding an Association Form</span></h3>
<div><span style="font-family: verdana,geneva;">To add an association form to any workflow perform the following steps.</span></div>
<ul>
<li><span style="font-family: verdana,geneva;">Right click the workflow folder and select "<strong>Add</strong>" - "<strong>New Item</strong>" from the context menu.</span></li>
</ul>
<p style="padding-left: 60px;"><span style="font-family: verdana,geneva;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/0160.AddNewItem.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/0160.AddNewItem.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/0160.AddNewItem.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/0160.AddNewItem.png" alt="" border="0" /></a></span></p>
<ul>
<li><span style="font-family: verdana,geneva;">On Add new Item Dialog, select "<strong>Workflow Association Form</strong>"&nbsp;on <strong>Office/SharePoint</strong> group</span></li>
</ul>
<p style="padding-left: 60px;"><span style="font-family: verdana,geneva;">&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/1738.AddAssocForm.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/1738.AddAssocForm.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/1738.AddAssocForm.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/1738.AddAssocForm.png" alt="" border="0" /></a></span></p>
<ul>
<li><span style="font-family: verdana,geneva;">This will add a new Association form like the one <a title="Sample OOB Association Form" href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/4336.AssociationForm.aspx" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/4336.AssociationForm.aspx">attached</a> to the workflow with default placeholders (2 text boxes, 1 date control, save and cancel button) and basic <strong>Ready to Customize</strong> CSOM code that could be a good starting point to&nbsp;build (customize)&nbsp;it with your own logic based on your business requirements.</span></li>
</ul>
<h3><span style="font-family: verdana,geneva;">Changes on workflow Elements.Xml </span></h3>
<p><span style="font-family: verdana,geneva;">Upon adding the association form,&nbsp;please ensure if the <strong>elements.xml</strong> associated with the workflow is updated with the entries highlighted below.</span></p>
<p>&lt;?xml version="1.0" encoding="utf-8" ?&gt;</p>
<p>&lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;</p>
<p>&nbsp; &lt;Module Name="Approval" Url="wfsvc/73C27777198F43B4A7C0FE6753ADA4C4"&gt;</p>
<p>&nbsp;&nbsp;&nbsp; &lt;File Url="Workflow.xaml" Type="GhostableInLibrary" Path="Approval\Workflow.xaml" Level="Published" DoGUIDFixUp="TRUE"&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Property Name="ContentTypeId" Value="0x01002A2479FF33DD4BC3B1533A012B653717004C4A72D4775DB04F8979AE7A4A568F20" /&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Property Name="ContentType" Value="WorkflowServiceDefinition" /&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Property Name="_ModerationStatus" Value="0" /&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Property Name="FileDirRef" Value="wfsvc/73C27777198F43B4A7C0FE6753ADA4C4" /&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Property Name="FSObjType" Value="0" /&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Property Name="FileLeafRef" Value="workflow.xaml" /&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Property Name="isReusable" Value="true" /&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Property Name="RequiresInitiationForm" Value="false" /&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="background-color: #ffff00;">&lt;Property Name="RequiresAssociationForm" Value="true" /&gt;</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Property Name="WSGUID" Value="{73C27777-198F-43B4-A7C0-FE6753ADA4C4}" /&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Property Name="WSPublishState" Value="3" /&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Property Name="WSDisplayName" Value="Approval" /&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Property Name="WSDescription" Value="Approval" /&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Property Name="RestrictToType" Value="List" /&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Property Name="DisableAutoStartCreate" Value="false" /&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Property Name="DisableManualStart" Value="false" /&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="background-color: #ffff00;">&lt;Property Name="AssociationUrl" Value="wfsvc/73C27777198F43B4A7C0FE6753ADA4C4/Approval/AssociationForm.aspx" /&gt;</span></p>
<p>&nbsp;&nbsp;&nbsp; &lt;/File&gt;</p>
<p><span style="background-color: #ffff00;">&nbsp;&nbsp;&nbsp; &lt;File Path="Approval\AssociationForm.aspx" Url="Approval/AssociationForm.aspx" /&gt;</span></p>
<p>&nbsp; &lt;/Module&gt;</p>
<p>&nbsp; &lt;ListInstance FeatureId="{2c63df2b-ceab-42c6-aeff-b3968162d4b1}"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TemplateType="4501"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Title="wfsvc"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Description="This list instance is used by SharePoint to keep track of workflows. Do not modify."</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Url="wfsvc"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RootWebOnly="FALSE" /&gt;</p>
<p>&lt;/Elements&gt;</p>
<h3><span style="font-family: verdana,geneva;">Customizing&nbsp;an Association Form</span></h3>
<p><span style="font-family: verdana,geneva;">By this time we will have a <strong>Ready to Customize </strong>association from its now time to go and customize the same.&nbsp;</span></p>
<p><span style="font-family: verdana,geneva;">The form will be enabled with the following&nbsp;JavaScript method with some default logic.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: terminal,monaco; font-size: small;">// ---------- Save workflow association ----------</span></p>
<p><span style="font-family: terminal,monaco; font-size: small;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">function</span></span></span> associateWF(state, pauseFunction) {</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">if</span></span></span> (complete != 0)</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">return</span></span></span> complete;</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">var</span></span></span> historyListId = <span style="color: #a31515;"><span style="color: #a31515;"><span style="color: #a31515;">""</span></span></span>;</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">var</span></span></span> taskListId = <span style="color: #a31515;"><span style="color: #a31515;"><span style="color: #a31515;">""</span></span></span>;</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">var</span></span></span> metadata = <span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">new</span></span></span> Object();</span></p>
<p style="padding-left: 30px;"><span style="color: #008000; font-family: terminal,monaco; font-size: small;"><span style="color: #008000;"><span style="color: #008000;">// Get form input values and set workflow in-argument values</span></span></span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">var</span></span></span> strInputValue = document.getElementById(<span style="color: #a31515;"><span style="color: #a31515;"><span style="color: #a31515;">"strInput"</span></span></span>).value;</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">if</span></span></span> (strInputValue) {</span></p>
<p style="padding-left: 60px;"><span style="font-size: small;"><span style="font-family: terminal,monaco;">metadata[</span><span style="font-family: terminal,monaco;"><span style="color: #a31515;"><span style="color: #a31515;"><span style="color: #a31515;">'strArg'</span></span></span>] = strInputValue;</span></span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">var</span></span></span> intInputValue = document.getElementById(<span style="color: #a31515;"><span style="color: #a31515;"><span style="color: #a31515;">"intInput"</span></span></span>).value;</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">if</span></span></span> (intInputValue) {</span></p>
<p style="padding-left: 60px;"><span style="font-family: terminal,monaco; font-size: small;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">var</span></span></span> intValue = parseInt(intInputValue);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p style="padding-left: 60px;"><span style="font-size: small;"><span style="color: #0000ff; font-family: Consolas;"><span style="color: #0000ff; font-family: Consolas;"><span style="color: #0000ff; font-family: Consolas;">if</span></span></span><span style="font-family: Consolas;"><span style="font-family: Consolas;"> (intValue)</span></span></span></p>
<p style="padding-left: 90px;"><span style="font-size: small;"><span style="font-family: terminal,monaco;">metadata[</span><span style="color: #a31515; font-family: Consolas;"><span style="color: #a31515; font-family: Consolas;"><span style="color: #a31515; font-family: Consolas;">'intArg'</span></span></span><span style="font-family: Consolas;"><span style="font-family: Consolas;">] = intValue;</span></span></span></p>
<p style="padding-left: 60px;"><span style="font-size: small;">}</span></p>
<p><span style="font-family: verdana,geneva;">we can customize this logic to retrieve the content from the modified form elements and might make it something like the following.</span></p>
<p><span style="font-family: terminal,monaco; font-size: small;">// ---------- Save workflow association ----------</span></p>
<p><span style="font-family: terminal,monaco; font-size: small;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">function</span></span></span> associateWF(state, pauseFunction) {</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">if</span></span></span> (complete != 0)</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">return</span></span></span> complete;</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">var</span></span></span> historyListId = <span style="color: #a31515;"><span style="color: #a31515;"><span style="color: #a31515;">""</span></span></span>;</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">var</span></span></span> taskListId = <span style="color: #a31515;"><span style="color: #a31515;"><span style="color: #a31515;">""</span></span></span>;</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">var</span></span></span> metadata = <span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">new</span></span></span> Object();</span></p>
<p style="padding-left: 30px;"><span style="color: #008000; font-family: terminal,monaco; font-size: small;"><span style="color: #008000;"><span style="color: #008000;">// Get form input values and set workflow in-argument values</span></span></span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">var</span></span></span> html = $(<span style="color: #a31515;"><span style="color: #a31515;"><span style="color: #a31515;">"#ctl00_PlaceHolderMain_spApprovers_upLevelDiv"</span></span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">var</span></span></span> approvers = $(<span style="color: #a31515;"><span style="color: #a31515;"><span style="color: #a31515;">"#divEntityData"</span></span></span>, html).attr(<span style="color: #a31515;"><span style="color: #a31515;"><span style="color: #a31515;">"key"</span></span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">if</span></span></span> (approvers &amp;&amp; approvers.length &gt; 0) {</span></p>
<p style="padding-left: 60px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;">metadata[<span style="color: #a31515;"><span style="color: #a31515;"><span style="color: #a31515;">'Approvers'</span></span></span>] = approvers;</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">else</span></span></span> {</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert(<span style="color: #a31515;"><span style="color: #a31515;"><span style="color: #a31515;">"Approvers field cannot be empty"</span></span></span>); <span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">return</span></span></span>;</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">var</span></span></span> intDurationDays = document.getElementById(<span style="color: #a31515;"><span style="color: #a31515;"><span style="color: #a31515;">"txtDurationDays"</span></span></span>).value;</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">if</span></span></span> (intDurationDays) {</span></p>
<p style="padding-left: 60px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">var</span></span></span> intValue = parseInt(intDurationDays);</span></p>
<p style="padding-left: 60px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">if</span></span></span> (intValue &amp;&amp; intValue &gt; 0) {</span></p>
<p style="padding-left: 60px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;">metadata[<span style="color: #a31515;"><span style="color: #a31515;"><span style="color: #a31515;">'Duration'</span></span></span>] = intValue;</span></p>
<p style="padding-left: 60px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;">}</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;"><span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">var</span></span></span> boolFirstApproval = document.getElementById(<span style="color: #a31515;"><span style="color: #a31515;"><span style="color: #a31515;">"chkFirstApproval"</span></span></span>);</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;">&nbsp;<span style="color: #0000ff;"><span style="color: #0000ff;"><span style="color: #0000ff;">if</span></span></span> (boolFirstApproval) {</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;">metadata[<span style="color: #a31515;"><span style="color: #a31515;"><span style="color: #a31515;">'EndonFirstApproval'</span></span></span>] = boolFirstApproval.checked;</span></p>
<p style="padding-left: 30px;"><span style="font-family: terminal,monaco; font-size: small; background-color: #ffff00;">}</span></p>
<p><span style="font-family: verdana,geneva;">In addition,</span><span style="font-family: verdana,geneva; background-color: #ffffff;"> the OOB method integrates the following logic as well.</span></p>
<ol>
<li><span style="font-family: verdana,geneva;">Get form input values and set workflow in-argument values</span></li>
<li><span style="font-family: verdana,geneva;">Sets History list id. If its new history list, creates new history list</span></li>
<li><span style="font-family: verdana,geneva;">Sets task list id. If its new task list, creates new task list</span></li>
<li><span style="font-family: verdana,geneva;">Checks, if task list contains the OOTB SharePoint 2013 Workflow Task content type</span></li>
<li><span style="font-family: verdana,geneva;"><span style="background-color: #ffffff;">Associates the workflow to selected triggering option selected on the previous workflow screen (Manual, Item Added, Item Updated)</span></span></li>
<li><span style="font-family: verdana,geneva;">If workflow association exists, then we will update its subscription information. Otherwise, it's a new association, and we will add the new subscription</span>.</li>
<li><span style="font-family: verdana,geneva;">Publish the workflow</span></li>
</ol>
<h3><span style="font-family: verdana,geneva;">Editing an existing workflow - Customizing the association form to populate the association parameters</span></h3>
<p><span style="font-family: verdana,geneva;">The Association form will not provide any option of populating the association parameter when editing an existing workflow. however this can be achieved by adding a new function and calling it from the function <span style="background-color: #ffff00;"><strong>setHeader()</strong></span> which gets executed upon load. For retrieving the subscription info, will have to create an instance of the workflow manger and call the method <strong>getSubscription </strong>by passing subscription id as an input parameter. The subscription id would be available pre set upon the page load, there is no need to retrieve the subscription id manually.</span></p>
<p><span style="font-family: verdana,geneva;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/3644.LoadExistingSubscription.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/3644.LoadExistingSubscription.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/3644.LoadExistingSubscription.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/3644.LoadExistingSubscription.png" alt="" border="0" /></a></span></p>
<p><span style="font-family: verdana,geneva;">Upon completion your association form is ready to go and get&nbsp;deployed.</span></p>
<h3><span style="font-family: verdana,geneva;">Samples</span></h3>
<p><span style="font-family: verdana,geneva;">Sample of a customized association form can be found <a title="Custom Association Form" href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/57/3833.AssociationForm[Custom].aspx" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-57/3833.AssociationForm_5B00_Custom_5D00_.aspx">here</a>.</span></p>
<p><span style="font-family: verdana,geneva;">Sample Approval workflow with a customized association form can be downloaded from <a title="Sample Approval Workflow" href="http://code.msdn.microsoft.com/SharePoint-2013-Approval-7c1c0b8d">here</a>.</span></p>]]></content:encoded>
    </item>
  </channel>
</rss>