Symptoms
The workflow is designed using K2 Studio in which I used a Smart Forms integration client event. A Smart Object has been create for a list on SharePoint Site. In the K2Designer I created a view with getlistitems method to allow users to attach multiple files to a SharePoint item. I executed the view and it worked fine. I created the form and run it is asking to enter username and password to connect to the SharePoint site. I have added the service accounts as SiteCollection administrators. Please see the error below.
Failed to initialize the Context: Url: https://denallix.com/sites/DFIT Username: Error Details: The remote server returned an error: (401) Unauthorized.
Diagnoses
The issue was the upload attachment event at the view level.
Resolution
I suggested that customer should use the form parameter to pass the item id into the Update List Item event, that resolved the issue.