UiPath Automating clicks of a list sequentially on a webpage - uipath

This is the website I am looking at.
In this website there is a list of companies where I can click into them:
Click the name of the company
Click the "Annual Report" button
Click the "Annual Report & CG Report - 2018" link
There are 788 companies in this list and I wish to repeat this process for the whole list.
Is this possible?
Currently I used Data Scraping -> Attach Browser url -> Extract Structured Data. After that I am stuck.

For me that sounds pretty simple:
go to overview
download the list via data scraping
for each on that list and surf to each of those urls
on the url do the things you said, like clicking the Annual Report and then Annual Report & CG Report - 2018
So the usual structure of a UiPath process is this one:
This is the Main.xaml visual overview that works on your example:
And this is the Main.xaml code:
<Activity mc:Ignorable="sap sap2010" x:Class="Main" mva:VisualBasic.Settings="{x:Null}" sap:VirtualizedContainerService.HintSize="530,1075" sap2010:WorkflowViewState.IdRef="ActivityBuilder_1" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sd="clr-namespace:System.Data;assembly=System.Data" xmlns:ui="http://schemas.uipath.com/workflow/activities" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<TextExpression.NamespacesForImplementation>
<scg:List x:TypeArguments="x:String" Capacity="22">
<x:String>System.Activities</x:String>
<x:String>System.Activities.Statements</x:String>
<x:String>System.Activities.Expressions</x:String>
<x:String>System.Activities.Validation</x:String>
<x:String>System.Activities.XamlIntegration</x:String>
<x:String>Microsoft.VisualBasic</x:String>
<x:String>Microsoft.VisualBasic.Activities</x:String>
<x:String>System</x:String>
<x:String>System.Collections</x:String>
<x:String>System.Collections.Generic</x:String>
<x:String>System.Data</x:String>
<x:String>System.Diagnostics</x:String>
<x:String>System.Drawing</x:String>
<x:String>System.IO</x:String>
<x:String>System.Linq</x:String>
<x:String>System.Net.Mail</x:String>
<x:String>System.Xml</x:String>
<x:String>System.Xml.Linq</x:String>
<x:String>UiPath.Core</x:String>
<x:String>UiPath.Core.Activities</x:String>
<x:String>System.Windows.Markup</x:String>
<x:String>UiPath.CV</x:String>
</scg:List>
</TextExpression.NamespacesForImplementation>
<TextExpression.ReferencesForImplementation>
<scg:List x:TypeArguments="AssemblyReference" Capacity="18">
<AssemblyReference>System.Activities</AssemblyReference>
<AssemblyReference>Microsoft.VisualBasic</AssemblyReference>
<AssemblyReference>mscorlib</AssemblyReference>
<AssemblyReference>System.Data</AssemblyReference>
<AssemblyReference>System</AssemblyReference>
<AssemblyReference>System.Drawing</AssemblyReference>
<AssemblyReference>System.Core</AssemblyReference>
<AssemblyReference>System.Xml</AssemblyReference>
<AssemblyReference>System.Xml.Linq</AssemblyReference>
<AssemblyReference>PresentationFramework</AssemblyReference>
<AssemblyReference>WindowsBase</AssemblyReference>
<AssemblyReference>PresentationCore</AssemblyReference>
<AssemblyReference>System.Xaml</AssemblyReference>
<AssemblyReference>UiPath.System.Activities</AssemblyReference>
<AssemblyReference>UiPath.UiAutomation.Activities</AssemblyReference>
<AssemblyReference>UiPath.CV</AssemblyReference>
<AssemblyReference>System.ValueTuple</AssemblyReference>
<AssemblyReference>System.Data.DataSetExtensions</AssemblyReference>
</scg:List>
</TextExpression.ReferencesForImplementation>
<Sequence sap:VirtualizedContainerService.HintSize="510,975" sap2010:WorkflowViewState.IdRef="Sequence_3">
<Sequence.Variables>
<Variable x:TypeArguments="sd:DataTable" Default="[New System.Data.DataTable]" Name="ExtractDataTable" />
<Variable x:TypeArguments="ui:Browser" Name="Browser" />
</Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:OpenBrowser CommunicationMethod="{x:Null}" Hidden="{x:Null}" NewSession="{x:Null}" Private="{x:Null}" BrowserType="Firefox" DisplayName="Open Browser" sap:VirtualizedContainerService.HintSize="468,351" sap2010:WorkflowViewState.IdRef="OpenBrowser_1" UiBrowser="[Browser]" Url="https://www.bursamalaysia.com/trade/trading_resources/listing_directory/main_market">
<ui:OpenBrowser.Body>
<ActivityAction x:TypeArguments="x:Object">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:Object" Name="ContextTarget" />
</ActivityAction.Argument>
<ui:BrowserScope Browser="{x:Null}" SearchScope="{x:Null}" TimeoutMS="{x:Null}" UiBrowser="{x:Null}" BrowserType="Firefox" DisplayName="Attach Browser" sap:VirtualizedContainerService.HintSize="434,252" sap2010:WorkflowViewState.IdRef="BrowserScope_2" InformativeScreenshot="49520eaf054f3a2d88e58aa9f0f1cdb7" Selector="<html app='firefox.exe' title='Main Market' />">
<ui:BrowserScope.Body>
<ActivityAction x:TypeArguments="x:Object">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:Object" Name="ContextTarget" />
</ActivityAction.Argument>
<ui:ExtractData DelayBetweenPagesMS="{x:Null}" ContinueOnError="True" DataTable="[ExtractDataTable]" DisplayName="Extract Structured Data" ExtractMetadata="<extract><column exact='1' name='Name' attr='text' name2='URL' attr2='href'><webctrl tag='tr'/><webctrl tag='td' class=' text-left position-relative'/><webctrl tag='a' class='company-announcement-link' idx='1'/></column></extract>" sap:VirtualizedContainerService.HintSize="334,106" sap2010:WorkflowViewState.IdRef="ExtractData_2" MaxNumberOfResults="100" NextLinkSelector="<webctrl parentid='DataTables_Table_0_next' tag='A' />" SimulateClick="True">
<ui:ExtractData.Target>
<ui:Target ClippingRegion="{x:Null}" Element="{x:Null}" InformativeScreenshot="c9106f042e4e67a92a010ed284896366" Selector="<webctrl parentid='DataTables_Table_0' tag='TBODY' />" WaitForReady="COMPLETE">
<ui:Target.TimeoutMS>
<InArgument x:TypeArguments="x:Int32" />
</ui:Target.TimeoutMS>
</ui:Target>
</ui:ExtractData.Target>
</ui:ExtractData>
</ActivityAction>
</ui:BrowserScope.Body>
</ui:BrowserScope>
</ActivityAction>
</ui:OpenBrowser.Body>
</ui:OpenBrowser>
<ui:ForEachRow CurrentIndex="{x:Null}" DataTable="[ExtractDataTable]" DisplayName="For Each Row" sap:VirtualizedContainerService.HintSize="468,492" sap2010:WorkflowViewState.IdRef="ForEachRow_1">
<ui:ForEachRow.Body>
<ActivityAction x:TypeArguments="sd:DataRow">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="sd:DataRow" Name="row" />
</ActivityAction.Argument>
<Sequence DisplayName="Body" sap:VirtualizedContainerService.HintSize="376,344" sap2010:WorkflowViewState.IdRef="Sequence_7">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:NavigateTo Browser="[Browser]" DisplayName="Navigate To" sap:VirtualizedContainerService.HintSize="334,59" sap2010:WorkflowViewState.IdRef="NavigateTo_1" Url="["https://www.bursamalaysia.com" + row("Url").ToString]" />
<Delay Duration="00:00:05" sap:VirtualizedContainerService.HintSize="334,22" sap2010:WorkflowViewState.IdRef="Delay_1" />
<ui:LogMessage DisplayName="Log Message" sap:VirtualizedContainerService.HintSize="334,91" sap2010:WorkflowViewState.IdRef="LogMessage_3" Level="Info" Message="["Here you do all the stuff like Click Annual Report..."]" />
</Sequence>
</ActivityAction>
</ui:ForEachRow.Body>
</ui:ForEachRow>
</Sequence>
</Activity>

Related

uipath error Click on onbeforeunload popup not working in chrome

I am facing issue with onbeforeunload window event popup in chrome. I have installed chrome extension.
Steps:
Create Open Browser activity with url:
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload"\
Create Click Event with selector:
<webctrl aaname='Click here to go to w3schools.com' tag='A' />
Create Click Event with selector:
<ctrl name='Leave site?' role='dialog' /><ctrl name='Leave' role='push button' />
My problem is the second click is not working.
Main.xaml:
<Activity mc:Ignorable="sap sap2010 sads" x:Class="Main" mva:VisualBasic.Settings="{x:Null}" sap2010:WorkflowViewState.IdRef="Main_1"
xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation"
xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
xmlns:ui="http://schemas.uipath.com/workflow/activities"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<TextExpression.NamespacesForImplementation>
<sco:Collection x:TypeArguments="x:String">
<x:String>System.Activities</x:String>
<x:String>System.Activities.Statements</x:String>
<x:String>System.Activities.Expressions</x:String>
<x:String>System.Activities.Validation</x:String>
<x:String>System.Activities.XamlIntegration</x:String>
<x:String>Microsoft.VisualBasic</x:String>
<x:String>Microsoft.VisualBasic.Activities</x:String>
<x:String>System</x:String>
<x:String>System.Collections</x:String>
<x:String>System.Collections.Generic</x:String>
<x:String>System.Data</x:String>
<x:String>System.Diagnostics</x:String>
<x:String>System.Drawing</x:String>
<x:String>System.IO</x:String>
<x:String>System.Linq</x:String>
<x:String>System.Net.Mail</x:String>
<x:String>System.Xml</x:String>
<x:String>System.Xml.Linq</x:String>
<x:String>UiPath.Core</x:String>
<x:String>UiPath.Core.Activities</x:String>
<x:String>System.Windows.Markup</x:String>
</sco:Collection>
</TextExpression.NamespacesForImplementation>
<TextExpression.ReferencesForImplementation>
<sco:Collection x:TypeArguments="AssemblyReference">
<AssemblyReference>System.Activities</AssemblyReference>
<AssemblyReference>Microsoft.VisualBasic</AssemblyReference>
<AssemblyReference>mscorlib</AssemblyReference>
<AssemblyReference>System.Data</AssemblyReference>
<AssemblyReference>System</AssemblyReference>
<AssemblyReference>System.Drawing</AssemblyReference>
<AssemblyReference>System.Core</AssemblyReference>
<AssemblyReference>System.Xml</AssemblyReference>
<AssemblyReference>System.Xml.Linq</AssemblyReference>
<AssemblyReference>UiPath.Core</AssemblyReference>
<AssemblyReference>UiPath.Core.Activities</AssemblyReference>
<AssemblyReference>PresentationFramework</AssemblyReference>
<AssemblyReference>WindowsBase</AssemblyReference>
<AssemblyReference>PresentationCore</AssemblyReference>
<AssemblyReference>System.Xaml</AssemblyReference>
<AssemblyReference>System.ComponentModel.Composition</AssemblyReference>
<AssemblyReference>System.ServiceModel</AssemblyReference>
</sco:Collection>
</TextExpression.ReferencesForImplementation>
<ui:OpenBrowser UiBrowser="{x:Null}" BrowserType="Chrome" DisplayName="Open browser" Hidden="False" sap2010:WorkflowViewState.IdRef="OpenBrowser_3" NewSession="True" Private="False" Url="https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload">
<ui:OpenBrowser.Body>
<ActivityAction x:TypeArguments="x:Object">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:Object" Name="ContextTarget" />
</ActivityAction.Argument>
<Sequence DisplayName="Do" sap2010:WorkflowViewState.IdRef="Sequence_25">
<ui:Click DelayBefore="{x:Null}" DelayMS="{x:Null}" ClickType="CLICK_SINGLE" DisplayName="Click 'A https://www.w3school...'" sap2010:WorkflowViewState.IdRef="Click_6" KeyModifiers="None" MouseButton="BTN_LEFT" SendWindowMessages="False" SimulateClick="False">
<ui:Click.CursorPosition>
<ui:CursorPosition Position="Center">
<ui:CursorPosition.OffsetX>
<InArgument x:TypeArguments="x:Int32" />
</ui:CursorPosition.OffsetX>
<ui:CursorPosition.OffsetY>
<InArgument x:TypeArguments="x:Int32" />
</ui:CursorPosition.OffsetY>
</ui:CursorPosition>
</ui:Click.CursorPosition>
<ui:Click.Target>
<ui:Target ClippingRegion="{x:Null}" Element="{x:Null}" TimeoutMS="{x:Null}" InformativeScreenshot="ad281f65b6ab6cc6ce588fb1cf53160a" Selector="<webctrl aaname='Click here to go to w3schools.com' tag='A' />" WaitForReady="INTERACTIVE" />
</ui:Click.Target>
</ui:Click>
<ui:Click DelayBefore="{x:Null}" DelayMS="{x:Null}" ClickType="CLICK_SINGLE" DisplayName="Click 'push button Leave'" sap2010:WorkflowViewState.IdRef="Click_5" KeyModifiers="None" MouseButton="BTN_LEFT" SendWindowMessages="False" SimulateClick="False">
<ui:Click.CursorPosition>
<ui:CursorPosition Position="Center">
<ui:CursorPosition.OffsetX>
<InArgument x:TypeArguments="x:Int32" />
</ui:CursorPosition.OffsetX>
<ui:CursorPosition.OffsetY>
<InArgument x:TypeArguments="x:Int32" />
</ui:CursorPosition.OffsetY>
</ui:CursorPosition>
</ui:Click.CursorPosition>
<ui:Click.Target>
<ui:Target ClippingRegion="{x:Null}" Element="{x:Null}" TimeoutMS="{x:Null}" InformativeScreenshot="a52efda054f51d9ac88fd53b22f4663a" Selector="<ctrl name='Leave site?' role='dialog' /><ctrl name='Leave' role='push button' />" WaitForReady="INTERACTIVE" />
</ui:Click.Target>
</ui:Click>
</Sequence>
</ActivityAction>
</ui:OpenBrowser.Body>
<sads:DebugSymbol.Symbol>dyhFOlxVaVBhdGhXb3Jrc3BhY2VcV2hhdHNhcHBNc2dcTWFpbi54YW1sBzoDYxQCAQE6vQE6iQICAQdACV8UAgECQQtPFgIBBVALXhYCAQNNngFN5AECAQZcngFc/QECAQQ=</sads:DebugSymbol.Symbol>
</ui:OpenBrowser>
<sap2010:WorkflowViewState.ViewStateManager>
<sap2010:ViewStateManager>
<sap2010:ViewStateData Id="Click_6" sap:VirtualizedContainerService.HintSize="314,106" />
<sap2010:ViewStateData Id="Click_5" sap:VirtualizedContainerService.HintSize="314,106" />
<sap2010:ViewStateData Id="Sequence_25" sap:VirtualizedContainerService.HintSize="336,376">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="OpenBrowser_3" sap:VirtualizedContainerService.HintSize="414,475" />
<sap2010:ViewStateData Id="Main_1" sap:VirtualizedContainerService.HintSize="454,635" />
</sap2010:ViewStateManager>
</sap2010:WorkflowViewState.ViewStateManager>
</Activity>
Which not working with script alerts.
Please find the solved workflow here. It's a tricky way to solve your problem.

How to create folder locally in system through UIpath

I want to create one master folder in C or D drive through UI path studio.After creating master folder,i want to crate three folder inside the master folder.
How to resolve this issue in UIpath?
Use the Create Directory activity in UiPath.
Just search for it in the Activites window.
you have to mention the path correctly like the below:-
"C:\Users\Documents\UiPath\Your_Folder_Name"
Create directory Activity will be the key to do this, before doing so, please make sure you (your UiPath) do have the privilege for creating folder in your C-Drive and/or D-Drive (if your C-Drive is readonly for your logged in user, the robot cannot do anything).
I wrote the following simple example which works for me, simply save them into a notepad with extension .xaml, and open with UiPath. By running it, your C-Drive and D-Drive should both be created with a folder called MasterFolderC or MasterFolderD, with 3 subfolders underneath.
Hope it helps.
<Activity mc:Ignorable="sap sap2010 sads" x:Class="Main" mva:VisualBasic.Settings="{x:Null}" sap2010:WorkflowViewState.IdRef="Main_1"
xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation"
xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
xmlns:ui="http://schemas.uipath.com/workflow/activities"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<TextExpression.NamespacesForImplementation>
<sco:Collection x:TypeArguments="x:String">
<x:String>System.Activities</x:String>
<x:String>System.Activities.Statements</x:String>
<x:String>System.Activities.Expressions</x:String>
<x:String>System.Activities.Validation</x:String>
<x:String>System.Activities.XamlIntegration</x:String>
<x:String>Microsoft.VisualBasic</x:String>
<x:String>Microsoft.VisualBasic.Activities</x:String>
<x:String>System</x:String>
<x:String>System.Collections</x:String>
<x:String>System.Collections.Generic</x:String>
<x:String>System.Data</x:String>
<x:String>System.Diagnostics</x:String>
<x:String>System.Drawing</x:String>
<x:String>System.IO</x:String>
<x:String>System.Linq</x:String>
<x:String>System.Net.Mail</x:String>
<x:String>System.Xml</x:String>
<x:String>System.Xml.Linq</x:String>
<x:String>UiPath.Core</x:String>
<x:String>UiPath.Core.Activities</x:String>
<x:String>System.Windows.Markup</x:String>
</sco:Collection>
</TextExpression.NamespacesForImplementation>
<TextExpression.ReferencesForImplementation>
<sco:Collection x:TypeArguments="AssemblyReference">
<AssemblyReference>System.Activities</AssemblyReference>
<AssemblyReference>Microsoft.VisualBasic</AssemblyReference>
<AssemblyReference>mscorlib</AssemblyReference>
<AssemblyReference>System.Data</AssemblyReference>
<AssemblyReference>System</AssemblyReference>
<AssemblyReference>System.Drawing</AssemblyReference>
<AssemblyReference>System.Core</AssemblyReference>
<AssemblyReference>System.Xml</AssemblyReference>
<AssemblyReference>System.Xml.Linq</AssemblyReference>
<AssemblyReference>UiPath.Core</AssemblyReference>
<AssemblyReference>UiPath.Core.Activities</AssemblyReference>
<AssemblyReference>PresentationFramework</AssemblyReference>
<AssemblyReference>WindowsBase</AssemblyReference>
<AssemblyReference>PresentationCore</AssemblyReference>
<AssemblyReference>System.Xaml</AssemblyReference>
<AssemblyReference>System.ComponentModel.Composition</AssemblyReference>
<AssemblyReference>System.ServiceModel</AssemblyReference>
</sco:Collection>
</TextExpression.ReferencesForImplementation>
<Flowchart sap2010:WorkflowViewState.IdRef="Flowchart_1">
<Flowchart.Variables>
<Variable x:TypeArguments="x:String" Default="C:\MasterFolderC\" Name="MasterPathC" />
<Variable x:TypeArguments="x:String" Default="D:\MasterFolderD\" Name="MasterPathD" />
</Flowchart.Variables>
<Flowchart.StartNode>
<FlowStep x:Name="__ReferenceID0" sap2010:WorkflowViewState.IdRef="FlowStep_4">
<Sequence DisplayName="Creating Folders" sap2010:WorkflowViewState.IdRef="Sequence_3">
<Sequence DisplayName="C-Drive" sap2010:WorkflowViewState.IdRef="Sequence_4">
<Sequence.Variables>
<Variable x:TypeArguments="x:Boolean" Name="pathExist" />
</Sequence.Variables>
<ui:PathExists DisplayName="Path exists" Exists="[pathExist]" sap2010:WorkflowViewState.IdRef="PathExists_2" Path="[MasterPathC]" PathType="Folder" />
<If Condition="[pathExist]" sap2010:WorkflowViewState.IdRef="If_7">
<If.Then>
<ui:CreateDirectory ContinueOnError="{x:Null}" DisplayName="Create directory" sap2010:WorkflowViewState.IdRef="CreateDirectory_5" Path="[MasterPathC]" />
</If.Then>
</If>
<ui:CreateDirectory ContinueOnError="{x:Null}" DisplayName="Create directory" sap2010:WorkflowViewState.IdRef="CreateDirectory_6" Path="[MasterPathC + "SubFolder1"]" />
<ui:CreateDirectory ContinueOnError="{x:Null}" DisplayName="Create directory" sap2010:WorkflowViewState.IdRef="CreateDirectory_7" Path="[MasterPathC + "SubFolder2"]" />
<ui:CreateDirectory ContinueOnError="{x:Null}" DisplayName="Create directory" sap2010:WorkflowViewState.IdRef="CreateDirectory_8" Path="[MasterPathC + "SubFolder3"]" />
</Sequence>
<Sequence DisplayName="D-Drive" sap2010:WorkflowViewState.IdRef="Sequence_5">
<Sequence.Variables>
<Variable x:TypeArguments="x:Boolean" Name="pathExist" />
</Sequence.Variables>
<ui:PathExists DisplayName="Path exists" Exists="[pathExist]" sap2010:WorkflowViewState.IdRef="PathExists_3" Path="[MasterPathD]" PathType="Folder" />
<If Condition="[pathExist]" sap2010:WorkflowViewState.IdRef="If_8">
<If.Then>
<ui:CreateDirectory ContinueOnError="{x:Null}" DisplayName="Create directory" sap2010:WorkflowViewState.IdRef="CreateDirectory_9" Path="[MasterPathD]" />
</If.Then>
</If>
<ui:CreateDirectory ContinueOnError="{x:Null}" DisplayName="Create directory" sap2010:WorkflowViewState.IdRef="CreateDirectory_10" Path="[MasterPathD + "SubFolder1"]" />
<ui:CreateDirectory ContinueOnError="{x:Null}" DisplayName="Create directory" sap2010:WorkflowViewState.IdRef="CreateDirectory_11" Path="[MasterPathD + "SubFolder2"]" />
<ui:CreateDirectory ContinueOnError="{x:Null}" DisplayName="Create directory" sap2010:WorkflowViewState.IdRef="CreateDirectory_12" Path="[MasterPathD + "SubFolder3"]" />
</Sequence>
</Sequence>
</FlowStep>
</Flowchart.StartNode>
<x:Reference>__ReferenceID0</x:Reference>
<sads:DebugSymbol.Symbol>dzFDOlxVc2Vyc1xtbWlhb1xEZXNrdG9wXFRlc3RpbmdXb3JrcGxhY2VcTWFpbi54YW1sIDsDZA8CAQE9ND1HAgEDPjQ+RwIBAkIJXxQCAQRDC1AWAgEaUQteFgIBBUcNR6MBAgEqSA1MEgIBJE0NTb8BAgEhTg1OvwECAR5PDU+/AQIBG1UNVaMBAgEVVg1aEgIBD1sNW8ABAgEMXA1cwAECAQldDV3AAQIBBkc9R0oCAS1Hf0eOAQIBK0gbSCgCASVKEUqqAQIBJ02UAU28AQIBIk6UAU68AQIBH0+UAU+8AQIBHFU9VUoCARhVf1WOAQIBFlYbVigCARBYEViqAQIBEluVAVu9AQIBDVyVAVy9AQIBCl2VAV29AQIBB0qYAUqnAQIBKFiYAVinAQIBEw==</sads:DebugSymbol.Symbol>
</Flowchart>
<sap2010:WorkflowViewState.ViewStateManager>
<sap2010:ViewStateManager>
<sap2010:ViewStateData Id="PathExists_2" sap:VirtualizedContainerService.HintSize="464,89" />
<sap2010:ViewStateData Id="CreateDirectory_5" sap:VirtualizedContainerService.HintSize="200,22" />
<sap2010:ViewStateData Id="If_7" sap:VirtualizedContainerService.HintSize="464,208" />
<sap2010:ViewStateData Id="CreateDirectory_6" sap:VirtualizedContainerService.HintSize="464,22" />
<sap2010:ViewStateData Id="CreateDirectory_7" sap:VirtualizedContainerService.HintSize="464,22" />
<sap2010:ViewStateData Id="CreateDirectory_8" sap:VirtualizedContainerService.HintSize="464,22" />
<sap2010:ViewStateData Id="Sequence_4" sap:VirtualizedContainerService.HintSize="200,51">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">False</x:Boolean>
<x:Boolean x:Key="IsPinned">False</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="PathExists_3" sap:VirtualizedContainerService.HintSize="464,89" />
<sap2010:ViewStateData Id="CreateDirectory_9" sap:VirtualizedContainerService.HintSize="200,22" />
<sap2010:ViewStateData Id="If_8" sap:VirtualizedContainerService.HintSize="464,208" />
<sap2010:ViewStateData Id="CreateDirectory_10" sap:VirtualizedContainerService.HintSize="464,22" />
<sap2010:ViewStateData Id="CreateDirectory_11" sap:VirtualizedContainerService.HintSize="464,22" />
<sap2010:ViewStateData Id="CreateDirectory_12" sap:VirtualizedContainerService.HintSize="464,22" />
<sap2010:ViewStateData Id="Sequence_5" sap:VirtualizedContainerService.HintSize="200,51">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">False</x:Boolean>
<x:Boolean x:Key="IsPinned">False</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="Sequence_3" sap:VirtualizedContainerService.HintSize="222,266">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="FlowStep_4">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<av:Point x:Key="ShapeLocation">200,127.5</av:Point>
<av:Size x:Key="ShapeSize">200,51</av:Size>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="Flowchart_1" sap:VirtualizedContainerService.HintSize="614,636">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">False</x:Boolean>
<av:Point x:Key="ShapeLocation">270,2.5</av:Point>
<av:Size x:Key="ShapeSize">60,75</av:Size>
<av:PointCollection x:Key="ConnectorLocation">300,77.5 300,127.5</av:PointCollection>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="Main_1" sap:VirtualizedContainerService.HintSize="654,716" />
</sap2010:ViewStateManager>
</sap2010:WorkflowViewState.ViewStateManager>
</Activity>

Change the "New" button Quote subgrid

The opportunity form as a quotes sub-grid. I am trying to hide the existing "New" button and create a custom one. Hiding the existing button works like a charm. However, nothing I do seems to make the custom button appear.
I have tried making the enable and visibility conditions as simple as just checking that the form is for an existing entity. Nothing seems to work.
Here's the XML for the quote. Generated using Ribbon Workbench:
<RibbonDiffXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CustomActions>
<CustomAction Id="ntcp.quote.Button1.Button.CustomAction" Location="Mscrm.SubGrid.quote.MainTab.Management.Controls._children" Sequence="17">
<CommandUIDefinition>
<Button Alt="$LocLabels:ntcp.quote.Button1.Button.Alt" Command="ntcp.quote.Command0.Command" Description="" Id="ntcp.quote.Button1.Button" Image32by32="/_imgs/ribbon/newrecord32.png" Image16by16="/_imgs/ribbon/New_16.png" LabelText="$LocLabels:ntcp.quote.Button1.Button.LabelText" Sequence="17" TemplateAlias="o1" ToolTipTitle="$LocLabels:ntcp.quote.Button1.Button.ToolTipTitle" ToolTipDescription="$LocLabels:ntcp.quote.Button1.Button.ToolTipDescription" ModernImage="New" />
</CommandUIDefinition>
</CustomAction>
<HideCustomAction HideActionId="ntcp.Mscrm.SubGrid.quote.AddNewStandard.Hide" Location="Mscrm.SubGrid.quote.AddNewStandard" />
</CustomActions>
<Templates>
<RibbonTemplates Id="Mscrm.Templates" />
</Templates>
<CommandDefinitions>
<CommandDefinition Id="ntcp.quote.Command0.Command">
<EnableRules>
<EnableRule Id="ntcp.quote.EnableRule0.EnableRule" />
</EnableRules>
<DisplayRules>
<DisplayRule Id="ntcp.quote.DisplayRule0.DisplayRule" />
</DisplayRules>
<Actions>
<JavaScriptFunction FunctionName="ntcp_QuoteFromOpportunity" Library="$webresource:ntcp_/quoteFromOpportunity.js" />
</Actions>
</CommandDefinition>
</CommandDefinitions>
<RuleDefinitions>
<TabDisplayRules />
<DisplayRules>
<DisplayRule Id="ntcp.quote.DisplayRule0.DisplayRule">
<FormStateRule State="Existing" Default="true" />
</DisplayRule>
</DisplayRules>
<EnableRules>
<EnableRule Id="ntcp.quote.EnableRule0.EnableRule">
<FormStateRule State="Existing" Default="true" />
</EnableRule>
</EnableRules>
</RuleDefinitions>
<LocLabels>
<LocLabel Id="ntcp.quote.Button1.Button.LabelText">
<Titles>
<Title description="Add New Quote" languagecode="1033" />
</Titles>
</LocLabel>
<LocLabel Id="ntcp.quote.Button1.Button.ToolTipTitle">
<Titles>
<Title description="Add New Quote" languagecode="1033" />
</Titles>
</LocLabel>
<LocLabel Id="ntcp.quote.Button1.Button.ToolTipDescription">
<Titles>
<Title description="Add New Quote" languagecode="1033" />
</Titles>
</LocLabel>
<LocLabel Id="ntcp.quote.Button1.Button.Alt">
<Titles>
<Title description="Add New Quote" languagecode="1033" />
</Titles>
</LocLabel>
</LocLabels>
</RibbonDiffXml>
Any ideas?
Is this CRM2011 or CRM2013? If it is CRM2013 you can't add a new button on the Form Subgrids - only on the full related subgrid view.
Buttons are visible by default, so you don't need any special Display/Enable rules.
Hope this helps,
Scott

Visual Studio Sharepoint 2013 Workflow not attaching to list

I have created a simple SP 2013 workflow in Visual Studio 2012. I configured it through the wizard to attach to a specific list. I am using a VM with windows server 2012, SP2013 in a standalone environment, and workflow manager. The solution deploys fine to SP and is activated, but does not get attached to the list. I went through the log files and found this:
Not enough information to determine a list for module "GuitarWorkflow". Assuming no list for this module.
Here is my elements/xaml contents:
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="GuitarWorkflow" Url="wfsvc/9fdef811d07146f6a4153dbf70de81b0">
<File Url="WorkflowStartAssociation" Path="GuitarWorkflow\WorkflowStartAssociation" Type="Ghostable">
<Property Name="WSDisplayName" Value="GuitarWorkflow - Workflow Start" />
<Property Name="ContentType" Value="WorkflowServiceSubscription" />
<Property Name="WSPublishState" Value="3" />
<Property Name="WSEventType" Value="WorkflowStart" />
<Property Name="WSEnabled" Value="true" />
<Property Name="WSGUID" Value="d68c7819-fd0c-4cb3-9537-bc099cc42e2e" />
<Property Name="WSEventSourceGUID" Value="{$ListId:Lists/Guitars;}" />
<Property Name="Microsoft.SharePoint.ActivationProperties.ListId" Value="{$ListId:Lists/Guitars;}" />
<Property Name="HistoryListId" Value="{$ListId:Lists/Workflow History;}" />
<Property Name="RestrictToScope" Value="{$ListId:Lists/Guitars;}" />
<Property Name="TaskListId" Value="(None)" />
</File>
<File Url="ItemAddedAssociation" Path="GuitarWorkflow\ItemAddedAssociation" Type="Ghostable">
<Property Name="WSDisplayName" Value="GuitarWorkflow - Item Added" />
<Property Name="ContentType" Value="WorkflowServiceSubscription" />
<Property Name="WSPublishState" Value="3" />
<Property Name="WSEventType" Value="ItemAdded" />
<Property Name="WSEnabled" Value="true" />
<Property Name="WSGUID" Value="4aa20a2f-81d0-41eb-b93d-a2d22b8b5e49" />
<Property Name="WSEventSourceGUID" Value="{$ListId:Lists/Guitars;}" />
<Property Name="Microsoft.SharePoint.ActivationProperties.ListId" Value="{$ListId:Lists/Guitars;}" />
<Property Name="HistoryListId" Value="{$ListId:Lists/Workflow History;}" />
<Property Name="RestrictToScope" Value="{$ListId:Lists/Guitars;}" />
<Property Name="TaskListId" Value="(None)" />
</File>
<File Path="GuitarWorkflow\Workflow.xaml" Url="GuitarWorkflow/Workflow.xaml" >
<Property Name="RestrictToScope" Value="{$ListId:Lists/Guitars;}" />
<Property Name="RestrictToType" Value="List" />
</File>
</Module>
<ListInstance FeatureId="{2c63df2b-ceab-42c6-aeff-b3968162d4b1}"
TemplateType="4501"
Title="wfsvc"
Description="This list instance is used by SharePoint to keep track of workflows. Do not modify."
Url="wfsvc"
RootWebOnly="FALSE" />
</Elements>
Here is my workflow xaml:
<Activity mc:Ignorable="sap sap2010 sads" x:Class="GuitarWorkflow.GuitarWorkflow.Workflow" sap2010:ExpressionActivityEditor.ExpressionActivityEditor="C#" sap2010:WorkflowViewState.IdRef="GuitarWorkflow.GuitarWorkflow.Workflow_1"
xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mca="clr-namespace:Microsoft.CSharp.Activities;assembly=System.Activities"
xmlns:msdad="clr-namespace:Microsoft.SharePoint.DesignTime.Activities.Design;assembly=Microsoft.SharePoint.DesignTime.Activities.Design"
xmlns:p="http://schemas.microsoft.com/workflow/2012/07/xaml/activities"
xmlns:p1="wf://workflow.windows.net/$Activities"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation"
xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<TextExpression.NamespacesForImplementation>
<sco:Collection x:TypeArguments="x:String">
<x:String>System</x:String>
<x:String>System.Collections.Generic</x:String>
<x:String>System.Data</x:String>
<x:String>System.Text</x:String>
<x:String>System.Collections.ObjectModel</x:String>
</sco:Collection>
</TextExpression.NamespacesForImplementation>
<TextExpression.ReferencesForImplementation>
<sco:Collection x:TypeArguments="AssemblyReference">
<AssemblyReference>Microsoft.Activities</AssemblyReference>
<AssemblyReference>Microsoft.SharePoint.DesignTime.Activities</AssemblyReference>
<AssemblyReference>PresentationFramework</AssemblyReference>
<AssemblyReference>System</AssemblyReference>
<AssemblyReference>System.Activities</AssemblyReference>
<AssemblyReference>System.Core</AssemblyReference>
<AssemblyReference>System.Data</AssemblyReference>
<AssemblyReference>System.Drawing</AssemblyReference>
<AssemblyReference>System.Runtime.Serialization</AssemblyReference>
<AssemblyReference>System.ServiceModel.Activities</AssemblyReference>
<AssemblyReference>System.Xaml</AssemblyReference>
<AssemblyReference>System.Xml</AssemblyReference>
<AssemblyReference>System.Xml.Linq</AssemblyReference>
<AssemblyReference>Microsoft.SharePoint</AssemblyReference>
<AssemblyReference>Microsoft.SharePoint.Client.ServerRuntime</AssemblyReference>
<AssemblyReference>mscorlib</AssemblyReference>
<AssemblyReference>GuitarWorkflow</AssemblyReference>
</sco:Collection>
</TextExpression.ReferencesForImplementation>
<Sequence sap2010:WorkflowViewState.IdRef="Sequence_1">
<Sequence.Variables>
<Variable x:TypeArguments="p:DynamicValue" Name="dv_0" />
<Variable x:TypeArguments="x:String" Name="GuitarType">
<Variable.Default>
<mca:CSharpValue x:TypeArguments="x:String">dv_0["Guitar Type"].ToString()</mca:CSharpValue>
</Variable.Default>
</Variable>
<Variable x:TypeArguments="sco:Collection(x:String)" Name="CreateBy" />
<Variable x:TypeArguments="x:String" Name="initiator" />
</Sequence.Variables>
<p1:WriteToHistory sap2010:WorkflowViewState.IdRef="WriteToHistory_1" Message="The GuitarWorkflow has started." />
<p1:LookupSPListItem ItemGuid="{x:Null}" Properties="{x:Null}" sap2010:WorkflowViewState.IdRef="LookupSPListItem_1">
<p1:LookupSPListItem.ItemId>
<InArgument x:TypeArguments="x:Int32">
<p:ExpressionContainerValue x:TypeArguments="x:Int32">
<p1:GetCurrentItemId />
</p:ExpressionContainerValue>
</InArgument>
</p1:LookupSPListItem.ItemId>
<p1:LookupSPListItem.ListId>
<InArgument x:TypeArguments="s:Guid">
<mca:CSharpValue x:TypeArguments="s:Guid">System.Guid.Parse("{$ListId:Lists/Guitars;}")</mca:CSharpValue>
</InArgument>
</p1:LookupSPListItem.ListId>
<p1:LookupSPListItem.Result>
<OutArgument x:TypeArguments="p:DynamicValue">
<mca:CSharpReference x:TypeArguments="p:DynamicValue">dv_0</mca:CSharpReference>
</OutArgument>
</p1:LookupSPListItem.Result>
</p1:LookupSPListItem>
<p:GetODataProperties DisplayName="GetDynamicValueProperties" sap2010:WorkflowViewState.IdRef="GetODataProperties_1">
<p:GetODataProperties.Source>
<InArgument x:TypeArguments="p:DynamicValue">
<mca:CSharpValue x:TypeArguments="p:DynamicValue">dv_0</mca:CSharpValue>
</InArgument>
</p:GetODataProperties.Source>
<scg:Dictionary x:TypeArguments="x:String, OutArgument">
<OutArgument x:TypeArguments="x:String" x:Key="Guitar_x0020_Type">
<mca:CSharpReference x:TypeArguments="x:String">GuitarType</mca:CSharpReference>
</OutArgument>
<OutArgument x:TypeArguments="sco:Collection(x:String)" x:Key="AuthorId">
<mca:CSharpReference x:TypeArguments="sco:Collection(x:String)">CreateBy</mca:CSharpReference>
</OutArgument>
</scg:Dictionary>
</p:GetODataProperties>
<If sap2010:WorkflowViewState.IdRef="If_1">
<If.Condition>
<InArgument x:TypeArguments="x:Boolean">
<mca:CSharpValue x:TypeArguments="x:Boolean">GuitarType.Equals("Acoustic")</mca:CSharpValue>
</InArgument>
</If.Condition>
<If.Then>
<p1:UpdateListItem ItemGuid="{x:Null}" ListItemProperties="{x:Null}" sap2010:WorkflowViewState.IdRef="UpdateListItem_1">
<p1:UpdateListItem.ItemId>
<InArgument x:TypeArguments="x:Int32">
<p:ExpressionContainerValue x:TypeArguments="x:Int32">
<p1:GetCurrentItemId />
</p:ExpressionContainerValue>
</InArgument>
</p1:UpdateListItem.ItemId>
<p1:UpdateListItem.ListId>
<InArgument x:TypeArguments="s:Guid">
<mca:CSharpValue x:TypeArguments="s:Guid">System.Guid.Parse("{$ListId:Lists/Guitars;}")</mca:CSharpValue>
</InArgument>
</p1:UpdateListItem.ListId>
<p1:UpdateListItem.ListItemPropertiesDynamicValue>
<InArgument x:TypeArguments="p:DynamicValue">
<p:SetDynamicValueProperties>
<scg:Dictionary x:TypeArguments="x:String, InArgument">
<InArgument x:TypeArguments="x:String" x:Key="Comment">VS Workflow added a comment: a new acoustic guitar item was added</InArgument>
</scg:Dictionary>
</p:SetDynamicValueProperties>
</InArgument>
</p1:UpdateListItem.ListItemPropertiesDynamicValue>
</p1:UpdateListItem>
</If.Then>
<If.Else>
<p1:UpdateListItem ItemGuid="{x:Null}" ListItemProperties="{x:Null}" sap2010:WorkflowViewState.IdRef="UpdateListItem_2">
<p1:UpdateListItem.ItemId>
<InArgument x:TypeArguments="x:Int32">
<p:ExpressionContainerValue x:TypeArguments="x:Int32">
<p1:GetCurrentItemId />
</p:ExpressionContainerValue>
</InArgument>
</p1:UpdateListItem.ItemId>
<p1:UpdateListItem.ListId>
<InArgument x:TypeArguments="s:Guid">
<mca:CSharpValue x:TypeArguments="s:Guid">System.Guid.Parse("{$ListId:Lists/Guitars;}")</mca:CSharpValue>
</InArgument>
</p1:UpdateListItem.ListId>
<p1:UpdateListItem.ListItemPropertiesDynamicValue>
<InArgument x:TypeArguments="p:DynamicValue">
<p:SetDynamicValueProperties>
<scg:Dictionary x:TypeArguments="x:String, InArgument">
<InArgument x:TypeArguments="x:String" x:Key="Comment">VS Workflow added a comment: a new electric guitar item was added</InArgument>
</scg:Dictionary>
</p:SetDynamicValueProperties>
</InArgument>
</p1:UpdateListItem.ListItemPropertiesDynamicValue>
</p1:UpdateListItem>
</If.Else>
</If>
<p1:LookupWorkflowContextProperty sap2010:WorkflowViewState.IdRef="LookupWorkflowContextProperty_1" PropertyName="InitiatorUserId">
<p1:LookupWorkflowContextProperty.Result>
<OutArgument x:TypeArguments="x:String">
<mca:CSharpReference x:TypeArguments="x:String">initiator</mca:CSharpReference>
</OutArgument>
</p1:LookupWorkflowContextProperty.Result>
</p1:LookupWorkflowContextProperty>
<p:BuildCollection x:TypeArguments="x:String">
<p:BuildCollection.Result>
<OutArgument x:TypeArguments="sco:Collection(x:String)">
<mca:CSharpReference x:TypeArguments="sco:Collection(x:String)">CreateBy</mca:CSharpReference>
</OutArgument>
</p:BuildCollection.Result>
<p:BuildCollection.Values>
<InArgument x:TypeArguments="x:String">
<mca:CSharpValue x:TypeArguments="x:String">initiator</mca:CSharpValue>
</InArgument>
</p:BuildCollection.Values>
<sap2010:WorkflowViewState.IdRef>BuildCollection`1_1</sap2010:WorkflowViewState.IdRef>
</p:BuildCollection>
<p1:Email AdditionalHeaders="{x:Null}" BCC="{x:Null}" CC="{x:Null}" sap2010:WorkflowViewState.IdRef="Email_1" Subject="New Guitar">
<p1:Email.Body>
<InArgument x:TypeArguments="x:String">
<mca:CSharpValue x:TypeArguments="x:String">"A new guitar was added:" + GuitarType</mca:CSharpValue>
</InArgument>
</p1:Email.Body>
<p1:Email.To>
<InArgument x:TypeArguments="sco:Collection(x:String)">
<mca:CSharpValue x:TypeArguments="sco:Collection(x:String)">CreateBy</mca:CSharpValue>
</InArgument>
</p1:Email.To>
</p1:Email>
<p1:WriteToHistory>
<p1:WriteToHistory.Message>
<InArgument x:TypeArguments="x:String">
<mca:CSharpValue x:TypeArguments="x:String">String.Format("An email was sent by {0}.", initiator)</mca:CSharpValue>
</InArgument>
</p1:WriteToHistory.Message>
<sap2010:WorkflowViewState.IdRef>WriteToHistory_3</sap2010:WorkflowViewState.IdRef>
</p1:WriteToHistory>
<p1:WriteToHistory sap2010:WorkflowViewState.IdRef="WriteToHistory_2" Message="Guitar Workflow has ended" />
<sads:DebugSymbol.Symbol>d3FDOlxVc2Vyc1xkZXZ1c2VyXGRvY3VtZW50c1x2aXN1YWwgc3R1ZGlvIDIwMTJcUHJvamVjdHNcR3VpdGFyV29ya2Zsb3dcR3VpdGFyV29ya2Zsb3dcR3VpdGFyV29ya2Zsb3dcV29ya2Zsb3cueGFtbCktA74BDgIBATILMmcCAQI4BTh3AgFhOQVLGwIBVUwFWhwCAUVbBZMBCgIBLZQBBZoBKAIBJpsBBacBGQIBG6gBBbMBEAIBD7QBBbsBGQIBCbwBBbwBcQIBBzhTOHQCAWJDC0N0AgFcSAtIWwIBVzwLPigCAVZUC1RbAgFQTwtPUwIBS1cLV2kCAUZeC15nAgEuYgl4HQIBPHsJkQEdAgEzlwELlwFaAgEolAF2lAGHAQIBJ6MBC6MBUgIBIZ4BC54BaQIBHLABC7ABYQIBFqsBC6sBbwIBEagBe6gBhwECARC3AQu3AX4CAQq8AVO8AW4CAQg9DT0kAwFWAXEPdS0CAUNsD2x4AgE+ZQ9nLAIBPYoBD44BLQIBOoUBD4UBeAIBNX4PgAEsAgE0c0pziwECAURmEWYoAwE9AYwBSowBiwECATt/EX8oAwE0AQ==</sads:DebugSymbol.Symbol>
</Sequence>
<sap2010:WorkflowViewState.ViewStateManager>
<sap2010:ViewStateManager>
<sap2010:ViewStateData Id="WriteToHistory_1" sap:VirtualizedContainerService.HintSize="464,68" />
<sap2010:ViewStateData Id="LookupSPListItem_1" sap:VirtualizedContainerService.HintSize="464,89">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<scg:Dictionary x:TypeArguments="x:String, msdad:ViewStateNameValue" x:Key="SPLocalizedDisplayNames">
<msdad:ViewStateNameValue x:Key="ItemId" DisplayName="(current item)" Value="$CurrentItemId" />
<msdad:ViewStateNameValue x:Key="ListId" DisplayName="Guitars" Value="Lists/Guitars" />
</scg:Dictionary>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="GetODataProperties_1" sap:VirtualizedContainerService.HintSize="464,92">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:String x:Key="Properties.SelectedEntityType">Lists/Guitars</x:String>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="UpdateListItem_1" sap:VirtualizedContainerService.HintSize="200,68">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<scg:Dictionary x:TypeArguments="x:String, msdad:ViewStateNameValue" x:Key="SPLocalizedDisplayNames">
<msdad:ViewStateNameValue x:Key="ItemId" DisplayName="(current item)" Value="$CurrentItemId" />
<msdad:ViewStateNameValue x:Key="ListId" DisplayName="Guitars" Value="Lists/Guitars" />
</scg:Dictionary>
<x:String x:Key="ListItemPropertiesDynamicValue.SelectedEntityType">Lists/Guitars</x:String>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="UpdateListItem_2" sap:VirtualizedContainerService.HintSize="200,68">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<scg:Dictionary x:TypeArguments="x:String, msdad:ViewStateNameValue" x:Key="SPLocalizedDisplayNames">
<msdad:ViewStateNameValue x:Key="ItemId" DisplayName="(current item)" Value="$CurrentItemId" />
<msdad:ViewStateNameValue x:Key="ListId" DisplayName="Guitars" Value="Lists/Guitars" />
</scg:Dictionary>
<x:String x:Key="ListItemPropertiesDynamicValue.SelectedEntityType">Lists/Guitars</x:String>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="If_1" sap:VirtualizedContainerService.HintSize="464,218" />
<sap2010:ViewStateData Id="LookupWorkflowContextProperty_1" sap:VirtualizedContainerService.HintSize="464,68">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<scg:Dictionary x:TypeArguments="x:String, msdad:ViewStateNameValue" x:Key="SPLocalizedDisplayNames">
<msdad:ViewStateNameValue x:Key="PropertyName" DisplayName="Initiator" Value="InitiatorUserId" />
</scg:Dictionary>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="BuildCollection`1_1" sap:VirtualizedContainerService.HintSize="464,22" />
<sap2010:ViewStateData Id="Email_1" sap:VirtualizedContainerService.HintSize="464,68" />
<sap2010:ViewStateData Id="WriteToHistory_3" sap:VirtualizedContainerService.HintSize="464,68" />
<sap2010:ViewStateData Id="WriteToHistory_2" sap:VirtualizedContainerService.HintSize="464,68" />
<sap2010:ViewStateData Id="Sequence_1" sap:VirtualizedContainerService.HintSize="486,1205">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="GuitarWorkflow.GuitarWorkflow.Workflow_1" sap:VirtualizedContainerService.HintSize="526,1285" />
</sap2010:ViewStateManager>
</sap2010:WorkflowViewState.ViewStateManager>
</Activity>
Not sure what I am doing wrong here. Any help is appreciated.
Edit. one other thing. I looked in the workflow manager database in sql express and only see info pertaining to WFs I created in SP Designer. I don't see this workflow. Not sure if I created the right kind of solution for deploying a VS workflow to Workflow Manager.
The problem was the following line in the workflow xaml:
<Variable x:TypeArguments="x:String" Name="GuitarType">
<Variable.Default>
<mca:CSharpValue x:TypeArguments="x:String">dv_0["Guitar Type"].ToString()</mca:CSharpValue>
</Variable.Default>
</Variable>
I was trying to apply a default value:
dv_0["Guitar Type"].ToString()
to a variable. I got the following error when deploying. I didn't see it in the original project:
Error occurred in deployment step 'Activate Features': Microsoft.Workflow.Client.ActivityValidationException: Workflow XAML failed validation due to the following errors:
The private implementation of activity '1: DynamicActivity' has the following validation error: Cast operation is not supported for DynamicValue => Object.
When I removed the default value, the workflow deployed

Unable to connect to TFS server on clicking View Test Results link in Build Summary

After running nunit tests as part of build process. I would like to see the results of that build. If I want to click on View Test Results link showing in log file opened in VS2010. then it at first throws up error saying unable to connect to server and on clicking again will display the reults in Test Results Window of VS2010. But it is also not displaying any view test results link in TFS web page where any one can see the results. Any idea what is missing.
4 projects/solutions compiled
1 test run(s) completed - 0% average pass rate (0% total pass rate)
0/1 test(s) passed, 1 failed, 0 inconclusive, View Test Results
No Code Coverage Results
My Changed build configuration file for Nunit:
<If Condition="[Not DisableTests]" DisplayName="If Not DisableTests" sap:VirtualizedContainerService.HintSize="1200,1867" mtbwt:BuildTrackingParticipant.Importance="Low">
<If.Then>
<Sequence DisplayName="Run Tests" sap:VirtualizedContainerService.HintSize="1075,1761" mtbwt:BuildTrackingParticipant.Importance="Low">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<If Condition="[Not TestSpecs Is Nothing]" DisplayName="If Not TestSpecs Is Nothing" sap:VirtualizedContainerService.HintSize="1053,1637" mtbwt:BuildTrackingParticipant.Importance="Low">
<If.Then>
<ForEach x:TypeArguments="mtbwa:TestSpec" DisplayName="For Each TestSpec in TestSpecs" sap:VirtualizedContainerService.HintSize="928,1531" mtbwt:BuildTrackingParticipant.Importance="Low" Values="[TestSpecs]">
<ActivityAction x:TypeArguments="mtbwa:TestSpec">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="mtbwa:TestSpec" Name="spec" />
</ActivityAction.Argument>
<TryCatch DisplayName="Try Run Tests" sap:VirtualizedContainerService.HintSize="898,1425" mtbwt:BuildTrackingParticipant.Importance="Low">
<TryCatch.Try>
<If Condition="[TypeOf spec Is Microsoft.TeamFoundation.Build.Workflow.Activities.TestMetadataFileSpec]" DisplayName="If spec Is TestMetadataFileSpec" sap:VirtualizedContainerService.HintSize="880,1238" mtbwt:BuildTrackingParticipant.Importance="None">
<If.Then>
<Sequence DisplayName="Run MSTest for Metadata File" sap:VirtualizedContainerService.HintSize="222,1132">
<Sequence.Variables>
<Variable x:TypeArguments="mtbwa:TestMetadataFileSpec" Name="testMetadataFile" />
<Variable x:TypeArguments="x:String" Name="localTestMetadata" />
</Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<Assign x:TypeArguments="mtbwa:TestMetadataFileSpec" DisplayName="Assign spec to testMetadataFile" sap:VirtualizedContainerService.HintSize="200,22" mtbwt:BuildTrackingParticipant.Importance="Low" To="[testMetadataFile]" Value="[DirectCast(spec, Microsoft.TeamFoundation.Build.Workflow.Activities.TestMetadataFileSpec)]" />
<mtbwa:ConvertWorkspaceItem DisplayName="Convert Server Path to Local Path" sap:VirtualizedContainerService.HintSize="200,22" mtbwt:BuildTrackingParticipant.Importance="Low" Input="[testMetadataFile.MetadataFileName]" Result="[localTestMetadata]" Workspace="[Workspace]" />
<mtbwa:MSTest Category="[testMetadataFile.CategoryFilter]" CommandLineArguments="[testMetadataFile.MSTestCommandLineArgs]" DisplayName="Run MSTest for Metadata File" Flavor="[platformConfiguration.Configuration]" sap:VirtualizedContainerService.HintSize="200,22" MaxPriority="[testMetadataFile.MaximumPriority]" MinPriority="[testMetadataFile.MinimumPriority]" PathToResultsFilesRoot="[TestResultsDirectory]" Platform="[platformConfiguration.Platform]" SearchPathRoot="[outputDirectory]" TestLists="[testMetadataFile.TestLists]" TestMetadata="[localTestMetadata]" TestSettings="[String.Empty]" />
</Sequence>
</If.Then>
<If.Else>
<Sequence DisplayName="Run NUnit for Test Assemblies" sap:VirtualizedContainerService.HintSize="633,1132" mtbwt:BuildTrackingParticipant.Importance="Low">
<Sequence.Variables>
<Variable x:TypeArguments="mtbwa:TestAssemblySpec" Name="testAssembly" />
<Variable x:TypeArguments="scg:IEnumerable(x:String)" Name="testAssemblies" />
<Variable x:TypeArguments="x:String" Default="[String.Empty]" Name="testFlavor" />
<Variable x:TypeArguments="x:String" Default="[String.Empty]" Name="testPlatform" />
<Variable x:TypeArguments="x:Int32" Name="NUnitResult" />
<Variable x:TypeArguments="x:String" Name="variable1" />
</Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<Assign x:TypeArguments="mtbwa:TestAssemblySpec" DisplayName="Assign spec to testAssembly" sap:VirtualizedContainerService.HintSize="611,22" mtbwt:BuildTrackingParticipant.Importance="Low" To="[testAssembly]" Value="[DirectCast(spec, Microsoft.TeamFoundation.Build.Workflow.Activities.TestAssemblySpec)]" />
<mtbwa:FindMatchingFiles DisplayName="Find Test Assemblies" sap:VirtualizedContainerService.HintSize="611,22" mtbwt:BuildTrackingParticipant.Importance="Low" MatchPattern="[String.Format("{0}\{1}", outputDirectory, testAssembly.AssemblyFileSpec)]" Result="[testAssemblies]" />
<If Condition="[testAssemblies.Count() > 0]" DisplayName="If Test Assemblies Found" sap:VirtualizedContainerService.HintSize="611,884" mtbwt:BuildTrackingParticipant.Importance="Low">
<If.Then>
<Sequence DisplayName="Run Tests and Publish Results" sap:VirtualizedContainerService.HintSize="486,778">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<mtbwa:InvokeProcess Arguments="[String.Format("/xml:nunit-tests.xml /framework:net-4.0 {0}", String.Join(" ",
testAssemblies))]" DisplayName="Invoke NUnit" FileName="[System.IO.Path.Combine(NUnitBinaryDirectory, "nunit-console.exe")]" sap:VirtualizedContainerService.HintSize="464,184" Result="[[NUnitResult]]" WorkingDirectory="[outputDirectory]">
<mtbwa:InvokeProcess.ErrorDataReceived>
<ActivityAction x:TypeArguments="x:String">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:String" Name="errOutput" />
</ActivityAction.Argument>
</ActivityAction>
</mtbwa:InvokeProcess.ErrorDataReceived>
<mtbwa:InvokeProcess.OutputDataReceived>
<ActivityAction x:TypeArguments="x:String">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:String" Name="stdOutput" />
</ActivityAction.Argument>
</ActivityAction>
</mtbwa:InvokeProcess.OutputDataReceived>
</mtbwa:InvokeProcess>
<mtbwa:InvokeProcess Arguments="[String.Format("-n {0} -t {1} -p ""{2}"" -f {3} -b ""{4}"" -v 2010",
"nunit-tests.xml",
BuildDetail.TeamProject,
BuildSettings.PlatformConfigurations(0).Platform,
BuildSettings.PlatformConfigurations(0).Configuration,
BuildDetail.BuildNumber)]" DisplayName=" Publish NUnit Results" FileName="[Path.Combine(NUnitTfsPublisherDirectory, "NUnitTfs.exe")]" sap:VirtualizedContainerService.HintSize="464,184" WorkingDirectory="[outputDirectory]">
<mtbwa:InvokeProcess.ErrorDataReceived>
<ActivityAction x:TypeArguments="x:String">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:String" Name="errOutput" />
</ActivityAction.Argument>
</ActivityAction>
</mtbwa:InvokeProcess.ErrorDataReceived>
<mtbwa:InvokeProcess.OutputDataReceived>
<ActivityAction x:TypeArguments="x:String">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:String" Name="stdOutput" />
</ActivityAction.Argument>
</ActivityAction>
</mtbwa:InvokeProcess.OutputDataReceived>
</mtbwa:InvokeProcess>
<If Condition="[NUnitResult <> 0]" DisplayName="If NUnit Tests Failed" sap:VirtualizedContainerService.HintSize="464,206">
<If.Then>
<Assign DisplayName="Set Test Status To Failed" sap:VirtualizedContainerService.HintSize="291,100">
<Assign.To>
<OutArgument x:TypeArguments="mtbc:BuildPhaseStatus">[BuildDetail.TestStatus]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="mtbc:BuildPhaseStatus">[Microsoft.TeamFoundation.Build.Client.BuildPhaseStatus.Failed]</InArgument>
</Assign.Value>
</Assign>
</If.Then>
</If>
</Sequence>
</If.Then>
</If>
</Sequence>
</If.Else>
</If>
Viewing test results in Web Access was not implemented for Dev10, neither was a protocol handler to open the test results file (trx) in Visual Studio. That explains why the build summary does not show the "View Test Results" link on TFS web page.
Per the Visual Studio issue, does it always throw "unable to connect to server" error the first time you click "View Test Results" in VS? And when you said "clicking again", you mean click "View Test Results" again? Can you check in the event log to see if there is any related error with more information.

Resources