Skip to main content

I've written some custom code in a K2 workflow and I am using the Microsoft.SharePoint assembly.

 

I set my site to

 

string mySiteURL = "http://mysite/";

 

Then using the class

 

 SPSite omySiteCollection = new SPSite(mySiteURL);

 Unfortunately when I try to do so I get the following error

 

 Line 12449: "58589103","2014-03-31 16:16:06","Info","General","0","InfoMessage","Approval Workflow","0 http://mysite/","XXXXXX :D:Program Files (x86)K2 blackpearlHost ServerBin","58589103","731f9125afa5469b8624367b4220239a",""

 

In reading about this error it seems as though it could be caused by K2 code executing outside of IIS causing a permissions error.

 

Questions:

 

  1. Is it possible to use the Microsoft.SharePoint assemblies from within K2 in a Code Reference Event to acces a SP site?
  2. What privilegea must be given, and where for K2 to access a SP site from a Code Reference Event?
  3. Would K2 need expanded privileges on the DB Server as well, beyond what it already has to function?

So you can access all of sharepoint directly from the K2 events.  Not sure why you would want to write code could you give a little more context of what you are trying to accomplish with the code? 


I'm comparing two columns from separate lists to get the ID from one of the lists. See this post: http://community.k2.com/t5/K2-blackpearl/Lookup-for-List-Item-Id-in-SharePoint-vs-Get-List-Items-in-K2/m-p/63098#M17655

This post can be seen as resolved as I've already written the code outside of K2 to accomplish this goal.


Reply