Hello everyone. Today, I’m very excited to introduce a few new features which we recently added to Workflow Actions Pack.
We wondered to utilize SharePoint REST API and make it more accessible for an end user.
So, please meet a new Get Items by Query workflow action.
This blog post appeared as an email response to one of our clients, he described very common use case where you have two libraries of documents, the first library where the users works with draft documents and the other library which is stored the final versions of documents. In this case, users want to be able to select finished documents and move it in one click.
Oblivious solution for this is to use a workflow that will move documents to the final document library. But there is one question how we can start the workflow on selected list items? When I was thinking about the answer to that question – I realized that is not as trivial as it seems, because list level workflow can be started only on singl document. How to start multiple workflows on selected documents? In the article, I will describe how you can implement such solution.
I divided this article into three main parts:
- Add custom button to the list ribbon
Before we start, I want to show what we will get in result. On the figure below you can see the custom button on the ribbon, which will launch a workflows on selected documents.
It is common scenario when you did some customizations, saved site as template and want to reuse it in SharePoint 2013. Such site templates can include workflows with custom workflow actions. Unfortunately if you save site with custom workflow actions as template and then try to create new site you can receive such annoying error:
Microsoft.Workflow.Client.ActivityNotFoundException:The activity named 'WorkflowXaml_988fe3c3_dc3e_47a9_8ff3_c912c82eb56d'from scope '/spo/216722f1-1dc0-4c6d-aafd-86b12ef60a14/1f87e1ae-da77-44d4-92d1-502507b5f2d4/34ceaf02-5217-46be-a307-e09dd93da230' was not found. HTTP headers received from the server -ActivityId:224e672a-4e00-44ed-8b55-894a059608c2.NodeId:.Scope:.ClientActivityId: f6cadd9c-c011-1000-aa42-85eedd28fc19.--->System.Net.WebException:The remote server returned an error
The reason of such behavior is related to incorrect processing of template by SharePoint 2013. I described it in detail in other my blog article. But this article is not about reasons of such behavior. We created small utility program TemplatePackageFix which fixes site templates with custom workflow actions and allows to reuse them as many times as you need.
We decided to implement such utility because some of our customers had questions about correct site template provisioning. Especially when custom site template included workflow actions from our product Workflow Actions Pack. Read more…
Usually SharePoint development process looks as follows. You create a new site which is based on one of the standard SharePoint templates (Team Site, Blog, Project Site, etc.) after that, you work hard and customize it very deep (add new lists, views, workflows, customize UI) and finally you will get complete business solution.
But there is another question: “How to deliver your solution to a client?”. One of the answers to this question is to use site templates. You can save customized site to WSP package and deploy the package to the customer’s environment.
The issue with deployment of template with custom workflow actions
Looks very interesting and useful, but in SharePoint’s world the Devil is in the detail. For example if you’re using custom workflow actions in your workflows you will get an error during deployment process:
Microsoft.Workflow.Client.ActivityNotFoundException: The activity named 'WorkflowXaml_988fe3c3_dc3e_47a9_8ff3_c912c82eb56d' from scope '/spo/216722f1-1dc0-4c6d-aafd-86b12ef60a14/1f87e1ae-da77-44d4-92d1-502507b5f2d4/34ceaf02-5217-46be-a307-e09dd93da230' was not found. HTTP headers received from the server - ActivityId: 224e672a-4e00-44ed-8b55-894a059608c2. NodeId: . Scope: . Client ActivityId : f6cadd9c-c011-1000-aa42-85eedd28fc19. ---> System.Net.WebException: The remote server returned an error