Why do you have to do this in workflow to link search results. This workflow is running excessively for every entry submitted by forms until a feature is added to link when saving to repository*. So I don't want unnecessary work.
What I am looking to do is this
CreateLinks(startingEntry,searchResults); OR foreach (Entry doc in searchResults) { CreateLink(startingEntry,doc); }
But what I am having to do is this
foreach (Entry doc in searchResults) { Entry copy = new Entry(doc.ID) CreateLink(startingEntry,copy); }
*The forms instance ID will not pass to workflow when calling directly (it is hidden in the list of variables and the Input Parameters are missing in the service task pane) preventing the ability for forms to inform workflow it is finished creating all documents when there are multiple save to repository tasks, so this workflow has to run on Entry Created by Forms and overload the links.