<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code Eater (Wael A. Kabli) : workarounds</title><link>http://blogs.msdn.com/wael/archive/tags/workarounds/default.aspx</link><description>Tags: workarounds</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Workflow "Failed on Start (retrying)"</title><link>http://blogs.msdn.com/wael/archive/2008/01/11/workflow-failed-on-start-retrying.aspx</link><pubDate>Fri, 11 Jan 2008 05:12:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7065768</guid><dc:creator>Wael A. Kabli</dc:creator><slash:comments>20</slash:comments><comments>http://blogs.msdn.com/wael/comments/7065768.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wael/commentrss.aspx?PostID=7065768</wfw:commentRss><wfw:comment>http://blogs.msdn.com/wael/rsscomments.aspx?PostID=7065768</wfw:comment><description>&lt;p&gt;Oh!! its SharePoint again :). One of these small things in this beast which makes you bang your head and pull your hear again and again if you don't get it right. Now lucky you you can search this issue and find the solution.&lt;/p&gt; &lt;p&gt;Debugging in SharePoint is very tricky sometimes because you get all of these levels to run around (GAC + IIS + Deployment Folder under the feature + Feature.xml + Workflow.xml + SharePoint itself + InfoPath the main form template + InfoPath the workflow forms&amp;nbsp;and &amp;nbsp;Web Services) so after this, it is not strange that you would start pulling your hear after a while.&lt;/p&gt; &lt;h1&gt;Problem Description:&lt;/h1&gt; &lt;p&gt;if you try any workflow (including OOB WF and Custom WF) and when you try to start it, it will show the message Workflow "Failed on Start (retrying)". You may also see that some tasks in the WF are created and even so it fails.&lt;/p&gt; &lt;p&gt;Tip: whenever you are stuck with your custom workflow, try having the OOB, if it doesn't run, its not your problem. (i spent one complete day almost 20H just to discover its not my fault).&lt;/p&gt; &lt;p&gt;One Proof that this thing its not your custom code problem, if you attach the WF process to Visual Studio, it will not catch any exception.&lt;/p&gt; &lt;h1&gt;Reasoning:&lt;/h1&gt; &lt;p&gt;In WSS/MOSS the workflow engine will report back 'a workflow failed to start' even if the workflow did start. &lt;p&gt;The reason why is that - the workflow will be sent the 'OnWorkflowActivated' event (start command) and essentially as far as MOSS is concerned - it's starting. &lt;p&gt;When the workflow for e.g. writes a task item and then waits (handleExternal Event) for the OnTaskChanged event. At this point if it failed - a different error other than 'failed to start' would be reported. &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt; &lt;h1&gt;Resolution:&lt;/h1&gt; &lt;ul&gt; &lt;li&gt;First and importantly check all your correlation tokens. make sure that each task (Creation, Updating and Completing) has its own Token not the workflow token.&lt;/li&gt; &lt;li&gt;Then compare the dll you have with theone in the workflow.xml and the one in the GAC. simply they all should be the same.&lt;/li&gt; &lt;li&gt;Try this on the command prompt: Lodctr "c:\Windows\Microsoft.Net\Framework\v3.0\Windows Workflow Foundation\perfcounters.ini"&lt;/li&gt; &lt;li&gt;And if it doesn't work for you try: Lodctr /R "c:\Windows\Microsoft.Net\Framework\v3.0\Windows Workflow Foundation\perfcounters.ini"&lt;/li&gt;&lt;/ul&gt; &lt;h1&gt;Some Links might Help:&lt;/h1&gt; &lt;p&gt;&lt;a title="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2268844&amp;amp;SiteID=1" href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2268844&amp;amp;SiteID=1"&gt;http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2268844&amp;amp;SiteID=1&lt;/a&gt;&lt;/p&gt; &lt;h1&gt;Some errors you might see in logs:&lt;/h1&gt; &lt;ul&gt; &lt;li&gt;The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.&lt;/li&gt; &lt;li&gt;Failed on Start (retrying).&lt;/li&gt; &lt;li&gt;&lt;em&gt;Unexpected&amp;nbsp;&amp;nbsp;&amp;nbsp; Load Workflow Class: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&amp;gt; System.InvalidOperationException: The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Diagnostics.PerformanceCounter.Initialize()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, Boolean readOnly)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Workflow.Runtime.PerformanceCounterManager.CreateCounters(String name)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Workflow.Runtime.Hosting.DefaultWorkflowSchedulerService.OnStarted()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Workflow.Runtime.Hosting.WorkflowRuntimeService.HandleStarted(Object source, WorkflowRuntimeEventArgs e)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.EventHandler`1.Invoke(Object sender, TEventArgs e)...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;01/11/2008 03:33:24.79*&amp;nbsp;&amp;nbsp;&amp;nbsp; w3wp.exe (0x12B4)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x0E9C&amp;nbsp;&amp;nbsp;&amp;nbsp; Windows SharePoint Services&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Workflow Infrastructure&lt;/em&gt;&lt;/li&gt; &lt;li&gt;Unexpected&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Workflow.Runtime.WorkflowRuntime.StartRuntime()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at Microsoft.SharePoint.Workflow.SPWinOeHostServices..ctor(SPSite site, SPWeb web, SPWorkflowManager manager, SPWorkflowEngine engine)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --- End of inner exception stack trace ---&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct&amp;amp; signature, IntPtr declaringType)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Ac...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;01/11/2008 03:33:24.79*&amp;nbsp;&amp;nbsp;&amp;nbsp; w3wp.exe (0x12B4)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x0E9C&amp;nbsp;&amp;nbsp;&amp;nbsp; Windows SharePoint Services&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Workflow Infrastructure&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 72fu&amp;nbsp;&amp;nbsp;&amp;nbsp; Unexpected&amp;nbsp;&amp;nbsp;&amp;nbsp; ...tivator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at Microsoft.SharePoint.Workflow.SPWorkflowManager.LoadPluggableClass(String classname, String assembly, Object[] parameters)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;01/11/2008 03:33:24.80&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; w3wp.exe (0x12B4)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x0E9C&amp;nbsp;&amp;nbsp;&amp;nbsp; Windows SharePoint Services&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Workflow Infrastructure&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7065768" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/wael/archive/tags/Wss/default.aspx">Wss</category><category domain="http://blogs.msdn.com/wael/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://blogs.msdn.com/wael/archive/tags/workflow/default.aspx">workflow</category><category domain="http://blogs.msdn.com/wael/archive/tags/workarounds/default.aspx">workarounds</category><category domain="http://blogs.msdn.com/wael/archive/tags/sharepoint/default.aspx">sharepoint</category></item><item><title>Attachments in InfoPath Form that is a Task Workflow</title><link>http://blogs.msdn.com/wael/archive/2007/12/26/attachments-in-infopath-form-that-is-a-task-workflow.aspx</link><pubDate>Wed, 26 Dec 2007 11:49:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6867949</guid><dc:creator>Wael A. Kabli</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/wael/comments/6867949.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wael/commentrss.aspx?PostID=6867949</wfw:commentRss><wfw:comment>http://blogs.msdn.com/wael/rsscomments.aspx?PostID=6867949</wfw:comment><description>&lt;p&gt;Woho, here is a nice one :), one of the small things that gets you sometimes bang your head for long long time till you find out what's the problem...&lt;/p&gt; &lt;h2&gt;Symptoms:&lt;/h2&gt; &lt;p&gt;So if you are having a workflow that uses InfoPath forms for tasks and you have attachment controls in it, then you probably faced this error: "The Selected file was not found"!!&lt;/p&gt; &lt;h2&gt;Solution or Workaround:&lt;/h2&gt; &lt;ul&gt; &lt;li&gt;Locate the ASPX page that your workflow form opens up in the _layouts directory on your server.&lt;/li&gt;&lt;/ul&gt; &lt;blockquote&gt; &lt;p&gt;e.g., %Program Files%Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\ &lt;p&gt;most probably you want WrkTaskIP.aspx --&amp;gt; this page is the one that loads your InfoPath form to be as a task form.&lt;/p&gt;&lt;/blockquote&gt; &lt;ul&gt; &lt;li&gt;in this aspx page, locate the reference to MasterPageFile. This will look something like &lt;/li&gt;&lt;/ul&gt; &lt;blockquote&gt; &lt;p&gt;MasterPageFile="~/_layouts/application.master"&lt;/p&gt;&lt;/blockquote&gt; &lt;ul&gt; &lt;li&gt;Go to the masterPage file you found&lt;/li&gt;&lt;/ul&gt; &lt;blockquote&gt; &lt;p&gt;In this case go to the application.master in the folder "%Program Files%Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\"&lt;/p&gt;&lt;/blockquote&gt; &lt;ul&gt; &lt;li&gt;Look for the Form Tag &lt;/li&gt;&lt;/ul&gt; &lt;blockquote&gt; &lt;p&gt;&amp;lt;form runat="server" onsubmit="return _spFormOnSubmitWrapper();"&amp;gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;ul&gt; &lt;li&gt;Add the attribute enctype="multipart/form-data" &amp;nbsp;to this tag and save.&lt;/li&gt;&lt;/ul&gt; &lt;blockquote&gt; &lt;p&gt;&amp;lt;form runat="server" onsubmit="return _spFormOnSubmitWrapper();" enctype="multipart/form-data"&amp;gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;ul&gt; &lt;li&gt;iisreset and try your workflow with file attachment again.&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;Few things to Note:&lt;/h2&gt; &lt;p&gt;as you can see, this is a product issue and hopefully it might be fixed in the SP1. But don't get frustrated, that's why we are blogging so you can find such information.&lt;/p&gt; &lt;p&gt;Have fun,,, :)&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6867949" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/wael/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://blogs.msdn.com/wael/archive/tags/InfoPath/default.aspx">InfoPath</category><category domain="http://blogs.msdn.com/wael/archive/tags/workflow/default.aspx">workflow</category><category domain="http://blogs.msdn.com/wael/archive/tags/workarounds/default.aspx">workarounds</category><category domain="http://blogs.msdn.com/wael/archive/tags/sharepoint/default.aspx">sharepoint</category><category domain="http://blogs.msdn.com/wael/archive/tags/product+issue/default.aspx">product issue</category><category domain="http://blogs.msdn.com/wael/archive/tags/Task+form/default.aspx">Task form</category><category domain="http://blogs.msdn.com/wael/archive/tags/The+Selected+file+was+not+found/default.aspx">The Selected file was not found</category></item><item><title>[InfoPath] How to filter data on IP web enabled</title><link>http://blogs.msdn.com/wael/archive/2007/04/17/infopath-how-to-filter-data-on-ip-web-enabled.aspx</link><pubDate>Tue, 17 Apr 2007 15:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2162987</guid><dc:creator>Wael A. Kabli</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/wael/comments/2162987.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wael/commentrss.aspx?PostID=2162987</wfw:commentRss><wfw:comment>http://blogs.msdn.com/wael/rsscomments.aspx?PostID=2162987</wfw:comment><description>&lt;P&gt;One of the famous pitfalls in InfoPath 2007 is thinking that it doesn't have the ability to filter while on web or incase of having web-enabled forms. The few coming line will explain this issue and why many fall into this confusion… &lt;/P&gt;
&lt;P&gt;Scenario: if you enabled web compatibility in IP 2007 and try to do a lookup on a field from a data source, sometimes you need to filter the information you get from external data source… &lt;/P&gt;
&lt;P&gt;Let's say you have the following data: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV&gt;Desktop Problems &lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;Hardware &lt;/LI&gt;
&lt;LI&gt;Software &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV&gt;Network Problems &lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;network cables &lt;/LI&gt;
&lt;LI&gt;IP telephone &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Filter: you want to filter the data you bind to your controls, let's say if you have two fields, you want to show in the first field Desktop Problems, the second field should show only hardware and software. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG style="WIDTH: 190px; HEIGHT: 71px" height=71 src="http://blogs.msdn.com/photos/waelsgallery/images/2163226/original.aspx" width=190 mce_src="http://blogs.msdn.com/photos/waelsgallery/images/2163226/original.aspx"&gt;&lt;/P&gt;
&lt;P&gt;Problem: if you try and filter on a field and the web compatibilities, you will get the following message: "Filtering is not supported in browser –enabled form templates." &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/waelsgallery/images/2163233/original.aspx" mce_src="http://blogs.msdn.com/photos/waelsgallery/images/2163233/original.aspx"&gt;&lt;/P&gt;
&lt;P&gt;Workaround: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Go to control you consider as primary field that it will be the filter key…in this case "MainDataSource.Category" &lt;/LI&gt;
&lt;LI&gt;Right click, properties and Add a rule on it .. &lt;/LI&gt;
&lt;LI&gt;
&lt;DIV&gt;The rule should have the following: &lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;Action: set a field's value &lt;/LI&gt;
&lt;LI&gt;Field: set the destination field where you want to filter your data. In this case "MainDataSource.SubCategories" &lt;/LI&gt;
&lt;LI&gt;
&lt;DIV&gt;Value: here you need to insert a field from the external data source such that the key field in your main data source is equal to the key field in the external data source. To do that do the following: &lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;Here is the tricky part. &lt;/LI&gt;
&lt;LI&gt;Click on the button (fx)… &lt;/LI&gt;
&lt;LI&gt;Click on insert a field or a group &lt;/LI&gt;
&lt;LI&gt;Choose the destination filed you want from the external data source. In this case "ExternalDataSource.SubCategories". &lt;/LI&gt;
&lt;LI&gt;Click on the "Filter Data". &lt;/LI&gt;
&lt;LI&gt;Click on Add &lt;/LI&gt;
&lt;LI&gt;You have the format: &amp;lt;&amp;lt;Value&amp;gt;&amp;gt; &amp;lt;&amp;lt;Comparison&amp;gt;&amp;gt; &amp;lt;&amp;lt;Value&amp;gt;&amp;gt; &lt;/LI&gt;
&lt;LI&gt;Choose: ExternalDataSource.KeyValue IsEqualTo MainDataSource.KeyValue &lt;/LI&gt;
&lt;LI&gt;In this case: ExternalDataSource.Category IsEqualTo MainDataSource.Category &lt;/LI&gt;
&lt;LI&gt;The click on "OK" Gazillion times. &lt;SPAN style="FONT-FAMILY: Wingdings"&gt;J&lt;/SPAN&gt; &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Go and Test…&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2162987" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/wael/archive/tags/InfoPath/default.aspx">InfoPath</category><category domain="http://blogs.msdn.com/wael/archive/tags/workarounds/default.aspx">workarounds</category><category domain="http://blogs.msdn.com/wael/archive/tags/webServices/default.aspx">webServices</category></item></channel></rss>