Skip to main content


 

Symptoms

 


Issues with Multi-select control and check box list
 

 

Diagnoses

 


Requirement:
In a smartform, to be able to select a few documents from Library 1 and create a docset in Library 2 and copy the selected documents into the docset.

Details:
I have 2 SharePoint document libraries, MDRLib and TestDocSet. MDRLib is the Source library and TestDocSet is the Destination. Document Set content type is enabled on TestDocSet. I have SmartObjects for MDRLib, TestDocSet and TestDocSet - Document Set.

In the View I'm using a Multi-select control to display a filtered list of documents from MDRLib. When the user selects some or all of the documents in the multi-select control and clicks on Submit button, I need to create a new document set in TestDocSet and copy the "selected" documents from MDRLib into the new docset in TestDocSet.

Form-ss1 shows screenshot of the form at runtime.

Issue 1: The Action "Execute a method on a View control for values that are in a specific state" does not appear for Multi-select control. As you can see in screenshot SS2, it lists only the Check box list control.

Issue 2: The action highlighted in the screenshot SS3, on Check Box List 1, how is it supposed to work? Is it supposed to iterate through each checked item and perform "Copy Document by ID" for each? It doesn't work, I have done the necessary configuration and _ID is set as the Value for Check box list.

Issue 3: Screenshot SS4 shows the output of the two controls. Multi-select produces an output in the format "12" as shown in the Transmittal Comments field and Check box list produces an output in the XML format as shown in the Transmittal Description field. Do I need to parse these values and perform "Copy Document By ID" for each value and how?

Either from Multi-select control or Check box list, I need to be able to loop through the selected items and copy document for each (using the ID to retrieve the document from MDRLib). If Multi-select has a known issue and we must use Check box list, then we need a "Select All" feature.
 

 

Resolution

We were able to achieve this requirement using a CheckBox List control and an Process that uses Plan-Per-Slot to create a "loop" behavior as per:

http://help.k2.com/kb000685

Some important configurations to make this work includes:
1. Using text > replace() function to convert the data passed in from the smartforms checkbox list to replace 'andlt' with '<' and 'andgt' with '>' before mapping it to the process level XML field
2. Creating the repeating process level XML node and non-repeating activitity level XML node, and enabling the "Generate sample XML file" for both XML structures

Please see attached 'CopyFileUsingProcess.docx' for more detail.

Another option would be available in Smartforms 4.6.9, scheduled to be released soon. K2 Smartforms 4.6.9 will have the following features that will allow you to execute an action against all items selected in a "list" type control on the Smartforms level:

- For Each Rule Condition
A rule condition for performing a set of actions for each item in a List control or List view.

- Multi-Select List View
The ability to select multiple items in a list view. Works in conjunction with the For Each rule condition.



 
Be the first to reply!

Reply