<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Lost in Technology</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/mittals/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/mittals/feed.xml</link>
    <description>My contribution to SharePoint development/Configuration</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:25:33 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Fixing the "The security validation of this page has timed out" error in SharePoint 2010.</title>
      <link>https://docs.microsoft.com/archive/blogs/mittals/fixing-the-the-security-validation-of-this-page-has-timed-out-error-in-sharepoint-2010</link>
      <pubDate>Fri, 19 Feb 2016 06:15:00 GMT</pubDate>
      <dc:creator><![CDATA[vamittal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mittals/2016/02/19/fixing-the-the-security-validation-of-this-page-has-timed-out-error-in-sharepoint-2010/</guid>
      <description><![CDATA[Ever faced the annoying "The security validation of this page has timed out" error in SharePoint...]]></description>
      <content:encoded><![CDATA[<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial, helvetica, sans-serif; font-size: small;">Ever faced the annoying "The security validation of this page has timed out" error in SharePoint 2010?</span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial, helvetica, sans-serif; font-size: small;">I believe, if you guys have ever used the following tag in a Custom SharePoint Application Page and were trying to validate the Form Digest token on the server for POST requests initiated using JavaScript, you might have encountered the error usually after 30 mins&nbsp;</span><span style="font-family: arial, helvetica, sans-serif; font-size: small;">of inactivity on the page.</span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="color: #993300;"><em><span style="font-family: arial, helvetica, sans-serif; font-size: medium;">&lt;SharePoint:FormDigest ID="fdToken" runat="server" /&gt;</span></em></span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial, helvetica, sans-serif; font-size: small;">The error encountered is as below:</span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial, helvetica, sans-serif; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/1134.FormDigest.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68/1134.FormDigest.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/1134.FormDigest.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68/1134.FormDigest.jpg" alt="" border="0" /></a></span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">&nbsp;</p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial, helvetica, sans-serif; font-size: medium;"><em style="color: #000000; text-transform: none; line-height: normal; text-indent: 0px; letter-spacing: normal; font-family: Arial, Helvetica, sans-serif; font-size: small; font-variant: normal; font-weight: normal; word-spacing: 0px; white-space: normal; widows: 1; background-color: #ffffff; -webkit-text-stroke-width: 0px;"><span style="text-decoration: underline;"><strong>Why timeout happens after 30 minutes &amp; what is the conventional way to fix this issue?</strong></span></em></span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial, helvetica, sans-serif; font-size: small;">I recommend to you to read the following post from Microsoft to understand the reason in detail:</span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-size: medium;"><a href="https://support.microsoft.com/en-us/kb/888828">https://support.microsoft.com/en-us/kb/888828</a></span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">&nbsp;</p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><em><span style="text-decoration: underline;"><strong>What's the fix?</strong></span></em></span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;">The fix is rather very simple and is a two step process in SharePoint 2010:</span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;">1. Execute any random query on SharePoint using JavaScript Client Side Object Model. I've used the following in my code:</span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial,helvetica,sans-serif;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/6735.Fix.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68/6735.Fix.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/6735.Fix.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68/6735.Fix.jpg" alt="" border="0" /></a></span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;">2. Fetch the&nbsp;value&nbsp;of &nbsp;request digest token again using the following code and&nbsp;assign it&nbsp;as the value of headers&nbsp;for your Ajax call:</span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><span style="font-size: medium;">$(<span style="color: #800000;"><span style="color: #800000;">"[name='__REQUESTDIGEST']"</span></span>).val();</span></em></span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">&nbsp;</p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial,helvetica,sans-serif; font-size: medium; text-decoration: underline;"><strong>Why would such a silly fix work?</strong></span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;">If you&nbsp;check the internals of the <span style="font-size: medium;"><em><strong>ClientContext</strong></em></span> class in <span style="font-size: medium;"><em><strong>Microsoft.SharePoint.Client.dll</strong></em></span>, you'll find the answer yourself. However, to save your effort of decompiling the dll here's the reason:</span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;">1. The <span style="font-size: medium;"><em><strong>ClientContext</strong></em></span>&nbsp;class has only one publicly overridden method - <span style="font-size: medium;"><em><strong>ExecuteQuery()</strong></em></span>. The code for <span style="font-size: medium;"><em><strong>ExecuteQuery()</strong></em></span> method after decompiling the dll is as below:</span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial,helvetica,sans-serif;"><strong><em><span style="font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/7343.executequery.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68/7343.executequery.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/7343.executequery.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68/7343.executequery.jpg" alt="" border="0" /></a></span></em></strong></span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;">If you check closely, the first call is made&nbsp;to the <em><strong><span style="font-size: medium;">EnsureFormDigest()</span></strong></em> method inside the <span style="font-size: medium;"><em><strong>ExecuteQuery()</strong></em></span> method. </span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;">2. Looking closely to what the <span style="font-size: medium;"><em><strong>EnsureFormDigest()</strong></em></span> method does will give you the answer. Here's is what it does:</span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/3288.ensureformdigest.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68/3288.ensureformdigest.jpg"><img style="width: 752px; height: 262px;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/3288.ensureformdigest.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68/3288.ensureformdigest.jpg" alt="" width="752" height="234" border="0" /></a></span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;">The <span style="font-size: medium;"><em><strong>EnsureFormDigest()</strong></em></span> method internally calls the <span style="font-size: medium;"><strong><em>BuildGetUpdatedFormDigestInforequestBody()</em></strong></span>&nbsp;method which makes sure that&nbsp;you always get the updated form digest token value instead of the stale in case you still are on the page and inactivity has occurred.&nbsp;</span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">&nbsp;</p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;">I hope this might prove useful to you.</span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Thanks!</span></p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">&nbsp;</p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">&nbsp;</p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">&nbsp;</p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">&nbsp;</p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">&nbsp;</p>
<p style="font: 12px/normal Arial, Helvetica, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Modifying hard coded URL for sub-reports, embedded datasource reference etc. in SSRS reports</title>
      <link>https://docs.microsoft.com/archive/blogs/mittals/modifying-hard-coded-url-for-sub-reports-embedded-datasource-reference-etc-in-ssrs-reports</link>
      <pubDate>Fri, 11 Jul 2014 14:20:00 GMT</pubDate>
      <dc:creator><![CDATA[vamittal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mittals/2014/07/11/modifying-hard-coded-url-for-sub-reports-embedded-datasource-reference-etc-in-ssrs-reports/</guid>
      <description><![CDATA[I recently faced an issue while migrating our SSRS reports from one server farm to another with...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: verdana, geneva; font-size: small;">I recently faced an issue while migrating our SSRS reports from one server farm to another with reports having an embedded data source, sub-report URL etc. in them. Needless to say but both the farms had different URLs:</span></p>
<p><span style="font-family: verdana, geneva; font-size: small;">For instance:</span></p>
<p><span style="font-family: verdana, geneva; font-size: small;">&ldquo;Farm A&rdquo; URL (Source) was something like: abc.example.com</span></p>
<p><span style="font-family: verdana, geneva; font-size: small;">And, &ldquo;Farm B&rdquo; URL (Destination) was similar to: xyz.domain.com&nbsp;</span></p>
<p><span style="font-family: verdana, geneva; font-size: small;">The issue could have been easily dealt with had the number of reports been small. In such a case manually editing the reports could have been an easier fix.</span></p>
<p><span style="font-family: verdana, geneva; font-size: small;">In our situation we had several thousand or reports and manually editing all of those seemed to be a daunting task and might have been error prone too.</span></p>
<p><span style="font-family: verdana, geneva; font-size: small;">Hence, to automate the process, I tried using the native web service exposed by report server in custom Power-Shell / C# code but could not find a way to modify sub-report URL. However, we did found out how to re-point our reports to the new data source using a combination of report server web service and Power-Shell&nbsp;script.</span></p>
<p><span style="font-family: verdana, geneva; font-size: small;">I tried binging a lot but could not find a tool relevant for our purpose which could provide a single solution to fix my entire problem.</span></p>
<p><span style="font-family: verdana, geneva; font-size: small;">So, did my problem get fixed? If yes, then how?</span></p>
<p><span style="font-family: verdana, geneva; font-size: small;">These are the set of questions you might be having by now. Well, the answer is to think about the unconventional ways to fix the problem and that's what I did.</span></p>
<p><span style="font-family: verdana, geneva; font-size: small;">We created our own tool to fix the problem.&nbsp;<a title="Click here" href="https://1drv.ms/1twvKhu">Click here</a>&nbsp;to download the tool.</span></p>
<p><span style="color: #ff0000;">Disclaimer:</span></p>
<p><span style="color: #ff0000;">MICROSOFT CORPORATION AND/OR ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY, RELIABILITY, OR ACCURACY OF THE INFORMATION AND RELATED GRAPHICS / FILES CONTAINED HEREIN. ALL SUCH INFORMATION AND RELATED GRAPHICS / FILES ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THIS INFORMATION AND RELATED GRAPHICS&nbsp;/ FILES, INCLUDING ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, WORKMANLIKE EFFORT, TITLE AND NON-INFRINGEMENT. YOU SPECIFICALLY AGREE THAT IN NO EVENT SHALL MICROSOFT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, PUNITIVE, INCIDENTAL, SPECIAL, CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF USE, DATA OR PROFITS, ARISING OUT OF OR IN ANY WAY CONNECTED WITH THE USE OF OR INABILITY TO USE THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN, WHETHER BASED ON CONTRACT, TORT, NEGLIGENCE, STRICT LIABILITY OR OTHERWISE, EVEN IF MICROSOFT OR ANY OF ITS SUPPLIERS HAS BEEN ADVISED OF THE POSSIBILITY OF DAMAGES.&nbsp;</span>&nbsp;</p>
<p><span style="font-family: verdana, geneva; font-size: small;">How does the tool look like? The tool looks like as shown in the screenshot below:</span>&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/58/68/2308.Modify%20URL.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68/2308.Modify-URL.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/2308.Modify%20URL.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68/2308.Modify-URL.png" alt="" border="0" /></a></p>
<p>&nbsp;<span style="font-family: verdana, geneva; font-size: small;">How to I use this tool? Please enlist the steps.</span></p>
<p><span style="font-family: verdana, geneva; font-size: small;">Well, it&rsquo;s very easy to use to tool. Please find the usage steps below:</span>&nbsp;</p>
<ol>
<li><span style="font-size: small;"><span style="font-family: verdana, geneva;">Download all the reports at a single location on your local machine. For example:&nbsp;</span><span style="font-family: verdana, geneva;">C:\users\testuser\Desktop (Desktop of testuser)</span></span></li>
<li><span style="font-family: verdana, geneva; font-size: small;">The reports can be saved all the root level of a folder or any structure within a folder.</span></li>
<li><span style="font-family: verdana, geneva; font-size: small;">Click &ldquo;Browse&rdquo; button corresponding to &ldquo;Select Report Folder&rdquo; textbox to select the source folder location where you have saved the reports from steps above.</span></li>
<li><span style="font-family: verdana, geneva; font-size: small;">Click &ldquo;Browse&rdquo; button corresponding to &ldquo;Save Reports Location&rdquo; textbox to select the target folder location to save the modified reports.</span></li>
<li><span style="font-family: verdana, geneva; font-size: small;">Modify the contents of textbox labeled as &ldquo;Search Text&rdquo;, with the value you wish to find and replace in the reports.</span></li>
<li><span style="font-family: verdana, geneva; font-size: small;">Modify the contents of textbox labeled as &ldquo;Replace Text&rdquo;, with the value you wish to replace &ldquo;Search Text&rdquo; within the reports.</span></li>
<li><span style="font-family: verdana, geneva; font-size: small;">Select the checkbox &ldquo;Do you wish to modify data source?&rdquo;, in case you wish to modify embedded data source references within the reports.</span></li>
<li><span style="font-family: verdana, geneva; font-size: small;">Click the &ldquo;Run&rdquo; button.</span></li>
<li><span style="font-family: verdana, geneva; font-size: small;">The execution might take some time based on the number of reports you&rsquo;re trying to modify.</span>&nbsp;</li>
</ol>
<p><span style="font-family: verdana, geneva; font-size: small;"><strong><span style="text-decoration: underline;">Output:</span></strong></span></p>
<p><span style="font-family: verdana, geneva; font-size: small;">The output will be in the form of the new reports those will be created at the destination path specified in the step# 4.</span></p>
<p><span style="font-family: verdana, geneva; font-size: small;">I re-deployed the new reports to SharePoint 2010 and they seem to reflect the correct references.</span></p>
<p><span style="font-family: verdana, geneva; font-size: small;"><strong><span style="text-decoration: underline;">Please Note:</span></strong></span></p>
<p><span style="font-family: verdana, geneva; font-size: small;">I tested the tool to work with reports deployed to Report Server in SharePoint integrated mode. However, the tool should also work fine for reports deployed to Report Server in Native Mode.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: verdana, geneva; font-size: small;">Happy Coding!</span></p>
<p><span style="font-family: verdana, geneva; font-size: small; color: #000000;">/Vaibhav</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Removing duplicate and empty items from an Array using Linq</title>
      <link>https://docs.microsoft.com/archive/blogs/mittals/removing-duplicate-and-empty-items-from-an-array-using-linq</link>
      <pubDate>Fri, 11 Jul 2014 06:09:24 GMT</pubDate>
      <dc:creator><![CDATA[vamittal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mittals/2014/07/11/removing-duplicate-and-empty-items-from-an-array-using-linq/</guid>
      <description><![CDATA[Most of the people in this world might be aware of the solution but sharing it ...just in case if...]]></description>
      <content:encoded><![CDATA[<p>Most of the people in this world might be aware of the solution but sharing it ...just in case if anyone might find it useful.</p>
<p>I was working on a code sample to remove all the duplicate and empty values from a String Array. I was trying a few approaches before I encountered the one solution using Linq that solved my problem.</p>
<p>The best part of it that I liked was that the approach was rather cleaner, easier, simple and elegant of all the ones i tried before.</p>
<p><strong><span style="text-decoration: underline;">Problem:</span></strong></p>
<p>Suppose you have an Array object say testArray&nbsp;of type string. The declaration of the array will be something like:</p>
<p>string[] testArray = new string[] {"A", "B", "C", "D","E","B","A","","E","","A","D","C"};</p>
<p>Now, you want the final result that would only contain following values:</p>
<p><strong><span style="text-decoration: underline;">Required result:</span></strong></p>
<p>"A", "B", "C", "D", "E" - Since they are all unique values and do not contain empty values like "" as well.</p>
<p>So, what would be your approach? Writing custom logic using loops? NAH..</p>
<p><strong><span style="text-decoration: underline;">Solution:</span></strong></p>
<p>I used a rather simple approach using Linq:</p>
<p>testArray&nbsp;= testArray&nbsp;.Except(new string[] { "" }).ToArray();</p>
<p><strong><span style="text-decoration: underline;">Final Result: <br /> <br /> </span></strong></p>
<p>The final values found in the array were as per the expectations:</p>
<p>"A", "B", "C", "D", "E"<strong></strong></p>
<p>IMO, the unique items are saved using Linq when the Linq tried to run equality comparer to compare values between source and resultant array.</p>
<p>&nbsp;</p>
<p>Happy Coding!</p>
<p>/Vaibhav</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Windows Azure: How to enable your Ethernet Network Adapter in an Azure VM?</title>
      <link>https://docs.microsoft.com/archive/blogs/mittals/windows-azure-how-to-enable-your-ethernet-network-adapter-in-an-azure-vm</link>
      <pubDate>Fri, 26 Jul 2013 01:34:00 GMT</pubDate>
      <dc:creator><![CDATA[vamittal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mittals/2013/07/26/windows-azure-how-to-enable-your-ethernet-network-adapter-in-an-azure-vm/</guid>
      <description><![CDATA[&#160;  What happens when you disable an Ethernet Network adapter in Windows Azure Virtual Machine?...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>What happens when you disable an Ethernet Network adapter in Windows Azure Virtual Machine? </p>  <p>How do you enable a Ethernet Network Adapter in Windows Azure Virtual Machine in case you have disabled it?</p>  <p>Is it possible to access the same virtual machine without deleting and re-creating the one from scratch in case you have disabled the one an only Ethernet network adapter?</p>  <p>&#160;</p>  <p>These were the sort of questions that I faced recently, after I created a new virtual machine in windows azure. I mistakenly disabled the one and only Ethernet network adapter in windows azure virtual machine. The impact of it was that I lost the access to the Azure VM’s remote desktop connection.</p>  <p>I was no longer able to access the VM remotely. I was having no clue as to how to access the VM again after losing the remote connectivity.</p>  <p>I tried searching for the options on my windows azure portal but could not find any interface where I can enable the adapter again. Interestingly, When I asked some people about the solution to this problem they also didn’t had any clue on how to achieve this task.</p>  <p>I thought that there must be some way out, hence downloaded the windows azure power shell module. Surprisingly, i cannot find any command-let in power shell that i can use to fix my issue.</p>  <p>After struggling for some time, I again went back to the windows azure portal and thought of expanding the VM size from small to medium. After i made this change, i tried accessing the VM again and woooo hoooo…. I was able to access it again. I than restored the VM again back to the size that i assigned it initially. Below are the steps on how you can achieve it.</p>  <p>1. Log in to your windows azure management portal</p>  <p>2. Select Virtual Machine as an option from the Left Navigation</p>  <p>3. Select the VM for which you need to enable the network adapter again</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/0218.image_174E8900.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/0218.image_5F00_174E8900.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/0763.image_thumb_515D55DF.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/0763.image_5F00_thumb_5F00_515D55DF.png" width="721" height="226" /></a></p>  <p>4. Click on the VM Name</p>  <p>5. Click on the CONFIGURE option on the top navigation</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/4745.image_08573419.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/4745.image_5F00_08573419.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/8507.image_thumb_7F872BCC.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/8507.image_5F00_thumb_5F00_7F872BCC.png" width="735" height="220" /></a></p>  <p>6. Change the VIRTUAL Machine Size to any value</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/2677.image_24A47639.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/2677.image_5F00_24A47639.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/2133.image_thumb_55577DE4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/2133.image_5F00_thumb_5F00_55577DE4.png" width="762" height="123" /></a></p>  <p>7. Save the changes by clicking the SAVE button that appears on the bottom of the screen</p>  <p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/6648.image_33F7D848.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/6648.image_5F00_33F7D848.png"><img style="display: inline;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/5706.image_thumb_7A74C850.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/5706.image_5F00_thumb_5F00_7A74C850.png" width="300" height="68" /></a></p>  <p>8. After the changes have been applied successfully, revert back the Virtual Machine Size to the original size that you’ve initially configured for this VM.</p>  <p>9. Try to establish a remote desktop connection with this VM, and you’ll now be able to successfully access it again that too without losing any data!</p>]]></content:encoded>
    </item>
    <item>
      <title>Debugging Remote Event Receivers in SharePoint 2013</title>
      <link>https://docs.microsoft.com/archive/blogs/mittals/debugging-remote-event-receivers-in-sharepoint-2013</link>
      <pubDate>Sun, 21 Apr 2013 05:35:24 GMT</pubDate>
      <dc:creator><![CDATA[vamittal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mittals/2013/04/21/debugging-remote-event-receivers-in-sharepoint-2013/</guid>
      <description><![CDATA[Alright, My Fellow SharePointers!!  Recently, I was trying to debug a new feature that is introduced...]]></description>
      <content:encoded><![CDATA[<p>Alright, My Fellow SharePointers!!</p>  <p>Recently, I was trying to debug a new feature that is introduced in SharePoint 2013 and I known to all of us by the name “Remote Event Receivers” or RERs. </p>  <p>&#160;</p>  <p>You might be wondering why I’m talking just about debugging this feature and not about the development aspects. </p>  <p>Well, this is due one simple reason which is Debugging a remote event receiver is/was an uphill task and I left it to you guys to decide it among yourselves if it was or its still a concern.</p>  <p>Ok, enough! Now, tell me what information you came with here:</p>  <p><strong>1. </strong><strong>“Remote event Receivers are not firing up or even if they are, then not all events that I’ve written code for are firing up”.</strong></p>  <p>In order to debug such scenarios, the first place that you should be looking at is “<strong>App for SharePoint Events</strong>” section in your app 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/58/68/metablogapi/4278.image_6017FED1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/4278.image_5F00_6017FED1.png"><img title="image" style="display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/2678.image_thumb_7AE6B58E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/2678.image_5F00_thumb_5F00_7AE6B58E.png" width="756" height="317" /></a> </p>  <p>&#160;</p>  <p>Alternatively, open your <strong>AppManifest.xml in code view</strong> and then look for the following section as depicted in screen shot below:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/0272.image_19BFBA1E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/0272.image_5F00_19BFBA1E.png"><img title="image" style="display: inline;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/5554.image_thumb_721BCEA4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/5554.image_5F00_thumb_5F00_721BCEA4.png" width="768" height="351" /></a> </p>  <p>Ok, coming back to the reason why I want you to look at these properties is simply because at times we may have written the code in our event receiver project (<strong>AppEventReceiver.svc file in this example</strong>) which handles all the app related events but, if any of the relative properties in your <strong>AppManifest.xml</strong> file is absent you’ll waste several hours trying to figure out what went wrong with your code and eventually you’ll start blaming the product for not functioning well.</p>  <p>&#160;</p>  <p><strong>2. “I’ve got the RTM version of Office developer tools for VS 2012 and I’ve got my Windows Azure Service Bus connection string, but still I’m unable to debug RERs”.</strong></p>  <p>(If you’re looking to find information on how to debug a RER with office developer tools for VS 2012, please check this <a href="https://blogs.msdn.com/b/officeapps/archive/2013/03/21/update-to-debugging-sharepoint-2013-remote-events-using-visual-studio-2012.aspx" target="_blank">blog by the Microsoft Office Team</a>)</p>  <p>The second reason is also tied up the one mentioned above. If you had forgot to set any of the app related events in your <strong>AppManifest.xml</strong> file for which you have handled the code in your Remote Event Receiver WCF Service, your debugger might not fire up. I’ve personally faced this particular issue and hence though of making you aware so that you won’t spend time to figure out what went wrong.</p>  <p>&#160;</p>  <p>Happy Coding!!!</p>  <p>&#160;</p>  <p>Cheers,</p>  <p>Vaibhav</p>]]></content:encoded>
    </item>
    <item>
      <title>How to create a Document Set in SharePoint 2013 using JavaScript Client Side Object Model (JSOM)?</title>
      <link>https://docs.microsoft.com/archive/blogs/mittals/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom</link>
      <pubDate>Tue, 02 Apr 2013 14:37:41 GMT</pubDate>
      <dc:creator><![CDATA[vamittal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mittals/2013/04/02/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom/</guid>
      <description><![CDATA[&#160;  Well SharePointers!   Challenge and Response are two things those have done wonders to the...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>Well SharePointers! </p>  <p>Challenge and Response are two things those have done wonders to the mankind!</p>  <p>Quiet recently, I got a challenge from someone to create a Document Set in SharePoint 2013 using JSOM (mind it! its JSOM not some .Net Managed CSOM or Server Side code)</p>  <p>The first challenge was to identify if the API is available or not. Truly speaking, I wasn’t quite frankly aware if such an API exists! </p>  <p>In my quest, I was helped by my colleague <strong>Gabriel Royer</strong> with not just finding the right API but also with debugging the errors in the sample code and writing the missing pieces that actually creates the Document Set. In fact, I could not have achieved this without Gabriel’s help.</p>  <p>Thanks a ton Gabriel!</p>  <p>I’ve listed the steps that you need to follow (The steps here are for the SharePoint hosted app):</p>  <p><strong><u>Create a Document Library:</u></strong></p>  <p>First, you need to <strong>create a Document Library and and Add a Content Type “Document Set”</strong> to the Document Library. For this APP, I’ve created a Document Library named “<strong>DocSetLibrary</strong>” in the Host Web.</p>  <p><strong><u>Add the right references:</u></strong></p>  <p>Secondly, you need to add the following references! Here you can use either the debug version of the files or the non-debug versions. (I’ve used the non-debug versions for debugging purpose).</p>  <blockquote>   <p>&lt;script type=&quot;text/javascript&quot; src=&quot;/_layouts/15/sp.runtime.js&quot;&gt;&lt;/script&gt;      <br />&lt;script type=&quot;text/javascript&quot; src=&quot;/_layouts/15/sp.js&quot;&gt;&lt;/script&gt;       <br />&lt;script type=&quot;text/javascript&quot; src=&quot;/_layouts/15/SP.DocumentManagement.js&quot;&gt;&lt;/script&gt; (This is the most important one!)</p>    <p>&lt;script type=&quot;text/javascript&quot; src=&quot;../Scripts/App.js&quot;&gt;&lt;/script&gt; (Reference to your app.js file)</p> </blockquote>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/7774.image_66E95A1C.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/7774.image_5F00_66E95A1C.png"><img style="display: inline;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/5102.image_thumb_4A8BF22F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/5102.image_5F00_thumb_5F00_4A8BF22F.png" width="819" height="456" /></a></p>  <p>&#160;</p>  <p><strong><u>Create Some Cool UI for your APP:</u></strong></p>  <p>Well next is to design some UI for the APP. (To keep things simple, I’ve just included a “Textbox” and a “Button”)</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/2068.image_5906EE54.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/2068.image_5F00_5906EE54.png"><img style="display: inline;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/3122.image_thumb_0BF67EBC.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/3122.image_5F00_thumb_5F00_0BF67EBC.png" width="819" height="484" /></a></p>  <p>&#160;</p>  <p><strong><u>Get App/Host Web URL:</u></strong></p>  <p>Well next is to get the App Web URL or the Host Web URL (get the appropriate URL where your Document Library exists, if in App Web get App Web URL otherwise get a Host Web URL)</p>  <p>You need to use the code below to get the APP/HOST Web Url.</p>  <p>// This code runs when the DOM is ready and creates a context object which is needed to use the SharePoint object model    <br />$(document).ready(function () {     <br />&#160;&#160;&#160; var params = document.URL.split(&quot;?&quot;)[1].split(&quot;&amp;&quot;);     <br />&#160;&#160;&#160; for (var i = 0; i &lt; params.length; i = i + 1) {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; var param = params[i].split(&quot;=&quot;);     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; switch (param[0]) {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &quot;SPAppWebUrl&quot;:     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SPAppWebUrl = decodeURIComponent(param[1]);     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &quot;SPHostUrl&quot;:     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SPHostUrl = decodeURIComponent(param[1]);     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }     <br />&#160;&#160;&#160; }     <br />});</p>  <p>function convertDataURIToBinary(dataURI) {    <br />&#160;&#160;&#160; var BASE64_MARKER = ';base64,';     <br />&#160;&#160;&#160; var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length;     <br />&#160;&#160;&#160; var base64 = dataURI.substring(base64Index);     <br />&#160;&#160;&#160; var raw = window.atob(base64);     <br />&#160;&#160;&#160; var rawLength = raw.length;     <br />&#160;&#160;&#160; var array = new Uint8Array(new ArrayBuffer(rawLength));     <br />&#160;&#160;&#160; for (i = 0; i &lt; rawLength; i++) {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; array[i] = raw.charCodeAt(i);     <br />&#160;&#160;&#160; }     <br />&#160;&#160;&#160; return array;     <br />}</p>  <p><strong><u>What is the Right API”?:</u></strong></p>  <p>The method to create the document set using the JSOM is <strong>SP.DocumentSet.DocumentSet.create</strong>. The biggest challenge is to get this work as there’s no documentation (apart from this post) on this API.</p>  <p>The method can be found in the JavaScript file “<strong>SP.DocumentManagement.js</strong>” which is located at “<strong>C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\SP.DocumentManagement.js</strong>”</p>  <p><strong><u></u></strong></p>  <p><strong><u>How to use it?</u></strong></p>  <p>Well, the <strong>create</strong> method expects some parameters like Client Context, Parent Folder, Document Set Name, and Content Type ID. Now, be aware that the value of <strong>Parent Folder and Content Type ID parameters can’t be of type String.</strong> You need to assign <strong>Folder Object</strong> to <strong>Parent Folder </strong>and <strong>Content Type ID Object </strong>to Content Type ID parameters.</p>  <p>The value of Content Type ID for Document Set is “<strong>0x0120D520</strong>”. This is a static value and won’t change but since this of type String, you need to get the object of this ID. </p>  <p>You can use the below method to get the content Type ID Object:</p>  <p>var docSetContentTypeID = &quot;0x0120D520&quot;;</p>  <p>var docsetContentType = web.get_contentTypes().getById(docSetContentTypeID);</p>  <p>and then use the <strong>docsetContentType.get_id() </strong>method to pass the content Type ID Object to the <strong>create</strong> method.</p>  <p>In case you’ll like to create the Document Set under the parent folder, use the code below:</p>  <p>parentFolder = list.get_rootFolder();</p>  <p>&#160;</p>  <p><strong><u>Enough of Explanation!&#160; Where’s is the code?</u></strong></p>  <p>Well, below is the way your final JavaScript function might look like. I’ve called this function on click of the “Create Document Set” button. </p>  <p>function CreateDocumentSet() {</p>  <p>var ctx = new SP.ClientContext(SPHostUrl);    <br />var parentFolder;     <br />var newDocSetName = $('#txtGetDocumentSetName').val();     <br />var docSetContentTypeID = &quot;0x0120D520&quot;;</p>  <p>var web = ctx.get_web();    <br />var list = web.get_lists().getByTitle('DocSetLibrary');     <br />ctx.load(list);</p>  <p>parentFolder = list.get_rootFolder();    <br />ctx.load(parentFolder);</p>  <p>var docsetContentType = web.get_contentTypes().getById(docSetContentTypeID);    <br />ctx.load(docsetContentType);</p>  <p>ctx.executeQueryAsync(function () {    <br />var isCreated = SP.DocumentSet.DocumentSet.create(ctx, parentFolder, newDocSetName, docsetContentType.get_id());     <br />ctx.executeQueryAsync(SuccessHandler('Document Set creation successful'), FailureHandler(&quot;Document Set creation failed&quot;));     <br /> }, FailureHandler(&quot;Folder loading failed&quot;));</p>  <p>   <br />ctx.add_requestSucceeded(function () {     <br /> $('#txtGetDocumentSetName').val('');     <br /> alert('Request Succeeded');     <br /> });</p>  <p>ctx.add_requestFailed(function (sender, args) {    <br /> alert('Request failed: ' + args.get_message());     <br /> });     <br />}</p>  <p>// Failure Message Handler</p>  <p>function FailureHandler(message) {    <br />&#160;&#160;&#160; return function (sender, args) {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; alert(message + &quot;: &quot; + args.get_message());     <br />&#160;&#160;&#160; }     <br />}</p>  <p>&#160;</p>  <p>// Success Message Handler</p>  <p>function SuccessHandler(message) {    <br />&#160;&#160;&#160; return function () {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; alert(message);     <br />&#160;&#160;&#160; }     <br />}</p>  <p><strong><u>APP Permissions:</u></strong></p>  <p>Lastly, you need to provide the <strong>Write</strong> permissions on the <strong>List </strong> in your AppManifest.xml file.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/2022.image_777F057D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/2022.image_5F00_777F057D.png"><img style="display: inline;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/2548.image_thumb_352BED3A.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/2548.image_5F00_thumb_5F00_352BED3A.png" width="816" height="398" /></a></p>  <p><strong><u></u></strong></p>  <p><strong><u></u></strong></p>  <p><strong><u>Where’s the final Visual Studio 2012 solution? I want to download it:</u></strong></p>  <p>You can download the Visual Studio Solution from my <a href="https://sdrv.ms/XbRgGw" target="_blank"><font size="4">Sky Drive folder</font></a>.</p>  <p><strong><u></u></strong></p>  <p><strong><u>How does the Final APP looks like? :</u></strong></p>  <p>The sample app looks similar to the one below:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/2022.image_2BEFB1F9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/2022.image_5F00_2BEFB1F9.png"><img style="display: inline;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/4276.image_thumb_1F155BDB.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/4276.image_5F00_thumb_5F00_1F155BDB.png" width="815" height="439" /></a></p>  <p>&#160;</p>  <p><strong><u>What’s the Output:</u></strong></p>  <p>Output will be similar to the one below:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/3187.image_4F5C3091.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/3187.image_5F00_4F5C3091.png"><img style="display: inline;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/4251.image_thumb_3F6CEBCD.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/4251.image_5F00_thumb_5F00_3F6CEBCD.png" width="820" height="455" /></a></p>]]></content:encoded>
    </item>
    <item>
      <title>Hybrid Search: Search Project Server 2013 Data using SharePoint 2013 Enterprise Search and Business Connectivity Services (BCS)</title>
      <link>https://docs.microsoft.com/archive/blogs/mittals/hybrid-search-search-project-server-2013-data-using-sharepoint-2013-enterprise-search-and-business-connectivity-services-bcs</link>
      <pubDate>Tue, 19 Mar 2013 01:13:00 GMT</pubDate>
      <dc:creator><![CDATA[vamittal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mittals/2013/03/19/hybrid-search-search-project-server-2013-data-using-sharepoint-2013-enterprise-search-and-business-connectivity-services-bcs/</guid>
      <description><![CDATA[This article is for you in case you are a &ldquo;Project Server and SharePoint 2013...]]></description>
      <content:encoded><![CDATA[<h5>This article is for you in case you are a &ldquo;Project Server and SharePoint 2013 Enthusiast&rdquo; !!!</h5>
<p>I have been working with SharePoint for some years, but this is the first time I decided to blog about something which talks about the integration points on SharePoint 2013 and Project Server 2013.&nbsp;</p>
<p>The driving force behind choosing this particular topic is the two-fold:</p>
<p>Firstly, there is not enough information available as the product is pretty new.</p>
<p>Secondly, due to the immense changes those had happened to the DB Schema for Project Server 2013.</p>
<p>A code sample already exists in MSDN code gallery (<a href="https://code.msdn.microsoft.com/PS2010Search">https://code.msdn.microsoft.com/PS2010Search</a>) which enables you to Search Project Server 2010 data using SharePoint BCS and FAST Search.</p>
<p>You can also refer to this <a href="https://blogs.msdn.com/b/chrisfie/archive/2010/07/09/search-project-server-2010-data-using-sharepoint-bcs-and-fast-search.aspx" target="_blank">blog</a> by one of my colleague <a href="https://social.msdn.microsoft.com/profile/christophe%20fiessinger/" target="_blank">Christophe Fiessinger</a> for more information.</p>
<p>Ok..coming back to the 2013 world...</p>
<p>With SharePoint 2013 and Project Server 2013&nbsp;hybrid search configuration, I&rsquo;ve configured the following service applications on the SharePoint 2013 side:</p>
<ol>
<li><strong>SharePoint 2013 Search Service Application</strong></li>
<li><strong>SharePoint 2013 Business Connectivity Service Application</strong></li>
<li><strong>SharePoint 2013 Secure Store Service Application</strong></li>
</ol>
<p>I&rsquo;ve also made some changes to the authentication mechanism for the BCS model. Instead of using the User Identity for accessing LOB Data, the new BCS models now will be configured to use Application ID defined in Secure Store service application and the user&rsquo;s identity will be mapped with all the domain users.</p>
<p>For more information, download the step-by-step document along with the BCS Models and the PowerShell scripts.</p>
<p>You can download all the stuff from <a title="here" href="https://blogs.msdn.com/controlpanel/blogs/files.aspx?WeblogID=15868&amp;folder=PS+2013+Search+Demo+Scripts+and+BCS+Models">here</a> or alternatively from&nbsp;my <a href="https://sdrv.ms/10eiPQo" target="_blank">Sky Drive folder</a> including the PowerShell scripts<span style="color: #ff0000; font-size: medium;">*</span></p>
<p><span style="color: #ff0000; font-size: x-small;">Disclaimer: <br />~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <br />By using the sample code you agree to be bound by the license terms below. </span></p>
<p><span style="color: #ff0000; font-size: x-small;">Any sample code is provided for the purpose of illustration only and is not intended to be used in a production environment. We grant you a nonexclusive, royalty-free right to use and modify the sample code and to reproduce and distribute the object code form of the sample code, provided that you agree: (i) to not use Microsoft's name, logo, or trademarks to market your software product in which the sample code is embedded; (ii) to include a valid copyright notice on your software product in which the sample code is embedded; (iii) to provide on behalf of and for the benefit of your subcontractors a disclaimer of warranties, exclusion of liability for indirect and consequential damages and a reasonable limitation of liability; and (iv) to indemnify, hold harmless, and defend Microsoft, its affiliates and suppliers from and against any third party claims or lawsuits, including attorneys' fees, that arise or result from the use or distribution of the sample code.</span></p>
<p>&nbsp;</p>
<p>Below are some sample queries from this solution those you can test in your environment:</p>
&nbsp;&nbsp;&nbsp;
<p><strong>Search a particular project:</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/58/68/metablogapi/1016.image_2A99D790.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/1016.image_5F00_2A99D790.png"><img style="display: inline;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/5518.image_thumb_1AAA92CC.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/5518.image_5F00_thumb_5F00_1AAA92CC.png" alt="image" width="770" height="300" border="0" /></a></p>
<p>&nbsp;</p>
<p><strong>Search all the tasks those are Milestone tasks:</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/58/68/metablogapi/3146.image_11DA8A80.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/3146.image_5F00_11DA8A80.png"><img style="display: inline;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/6170.image_thumb_24AF0E2A.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/6170.image_5F00_thumb_5F00_24AF0E2A.png" alt="image" width="793" height="376" border="0" /></a></p>
<p>&nbsp;</p>
<p><strong>Search all the Active Resources:</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/58/68/metablogapi/1055.image_3B8DDFA6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/1055.image_5F00_3B8DDFA6.png"><img style="display: inline;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/68/metablogapi/7713.image_thumb_3970E0DD.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-68-metablogapi/7713.image_5F00_thumb_5F00_3970E0DD.png" alt="image" width="806" height="457" border="0" /></a></p>]]></content:encoded>
    </item>
  </channel>
</rss>