Symptoms
Last week I upgraded from 4.6.7 to the latest 4.6.11. In 4.6.7 I had built a view/form that would call a workflow via a button. A link to the task is sent to the assigned user that opens the Edit view and actions the task. That worked just fine.
With the latest version installed I cannot figure out how to do the same thing. There is a new "item reference" and the ID does not seem to pass thru from the workflow into the View. I get an error :
SmartObject property ID is a required property for selected method GetListItem. Value must be set.
Type:
System.NullReferenceException
Source:
SourceCode.SmartObjects.Client
Method Base
Member Type:
Method
Name:
Validate
Module
Scope Name:
SourceCode.SmartObjects.Client.dll
Declaring Type
Full Name:
SourceCode.SmartObjects.Client.SmartObject
Stack Trace:
at SourceCode.SmartObjects.Client.SmartObject.Validate(Boolean isList)
at SourceCode.SmartObjects.Client.SmartObjectClientServer.ExecuteScalar(SmartObject smartObject, DataTable inputTable)
at SourceCode.Forms.AppFramework.FormRuntime.SmartObjectExecution(XPathNavigator nav, Boolean outputDependencies, SmartObjectClientServer svr)
at SourceCode.Forms.AppFramework.FormRuntime.WorkXmlToApi(String xml)
at SourceCode.Forms.Runtime.AJAXCall.ProcessRequest(HttpContext context)
Diagnoses
When trying to configure rule to start K2 workflow from K2 for SharePoint generated form by clicking on the button, the button need to be on the form. So that when you configure the rule you are able to pass SharePoint list and its attachment SmartObject in the item reference on the rule.
Resolution
Adding the button on the form and passing SharePoint List and its Attachment SmartObjects to the item references on the rule, resolves the issue.