Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I`v asked the same question: <a href="https://stackoverflow.com/questions/1231725/sync-list-with-outlook-only-with-items-in-current-view">Sync list with outlook only with items in current view.</a>. In this case it was possible to use stssync protocol to do whatever you want. It takes much effort (luckily someone already wrote an <a href="http://stssyncprovider.codeplex.com/" rel="nofollow noreferrer">implementation</a>)</p> <p>But there was another solution i ended up using - implementing a wrapper for Lists.asmx webservice and rewriting outlook requests (by using custom Global.asax file) to use this new webservice instead of Lists.asmx, that only queries specific view in a list.</p> <pre><code>if (ctx.Request.UserAgent.Contains("Microsoft Office Outlook") &amp;&amp; path.ToLower().IndexOf("_vti_bin/lists.asmx") &gt;= 0) { ctx.RewritePath("/_layouts/OutlookLists.asmx"); } </code></pre> <p>I'm not sure you would want a solution like this. If you do, you may ask and i may publish the solution source for the webservice, however i'm not using this webservice myself anymore. And you could use it as a draft, not a production ready code.</p> <p>The source has been published on <a href="http://syncspviewoutlook.codeplex.com/" rel="nofollow noreferrer">CodePlex</a>.</p> <h2>Regarding to the script problem</h2> <p>I don't know why list id isn't being replaced by view id. I tried to run the function within script console (F12 for IE8/9)</p> <pre><code>&gt;&gt; var menuItems = document.getElementsByTagName('ie:menuitem'); for (var i = 0; i &lt; menuItems.length; i++) { itm = menuItems(i); if (itm.id.match('OfflineButton') != null) { console.log('listName:' + ctx.listName.toLowerCase() + 'viewName:' + ctx.view.toLowerCase()); if (ctx != null &amp;&amp; ctx.listName != null &amp;&amp; ctx.view != null) { console.log('Inside if block'); //Replace listId to viewId being used so outlook will query only items in current view. //Must have custom web service in place to handle that request, because it iwll not work OOTB. console.log("Before: " + itm.onMenuClick); itm.onMenuClick = itm.onMenuClick.replace(ctx.listName.toLowerCase(), ctx.view.toLowerCase()); console.log("After: " + itm.onMenuClick); break; } } } LOG: listName:{fe89e809-7de4-4f43-9bc2-7e8ce6624ed0}viewName:{7364a843-c7f2-47d8-b4a3-5dc7381b6248} LOG: Inside if block LOG: Before: javaScript:ExportHailStorm('tasks','https:\u002f\u002fserver\u002fsapulces\u002fdarbu_parskata','{fe89e809-7de4-4f43-9bc2-7e8ce6624ed0}','Uz\u0146\u0113muma darbu p\u0101rskata sapulce','Uzdevumi','\u002fsapulces\u002fdarbu_parskata\u002fLists\u002fUzdevumi','','\u002fsapulces\u002fdarbu_parskata\u002fLists\u002fUzdevumi'); LOG: After: javaScript:ExportHailStorm('tasks','https:\u002f\u002fserver\u002fsapulces\u002fdarbu_parskata','{7364a843-c7f2-47d8-b4a3-5dc7381b6248}','Uz\u0146\u0113muma darbu p\u0101rskata sapulce','Uzdevumi','\u002fsapulces\u002fdarbu_parskata\u002fLists\u002fUzdevumi','','\u002fsapulces\u002fdarbu_parskata\u002fLists\u002fUzdevumi'); </code></pre> <p>As you can see, the function argument (third one) has been replaced with a view id instead of list id.</p> <p>Don't forget to remove console.log statements before deploying, because if IE doesn't have web developer tools, javascript will crash there.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload