Skip to main content
Nintex Community Menu Bar

Create SharePoint folders...

  • October 10, 2006
  • 2 replies
  • 23 views

Forum|alt.badge.img+4
Hello all,

I want to know can we, once a user decides to attach a document to a Smartform with the K2DocAttachment control, create a folder in a SharePoint library and copy the newly attached document into that new folder? + The folder name should come from an XML Field.

The approach I'm thinking is forcing the attached document to copy itself in a temporary Sharepoint document library and then, before the next activity, insert events that will create de new SPS folder and move the document. Insert, afterwards, the new URL in the activity's SmartForm for user to click on it's hyperlink to get the file. Is this the right path? Or am I totally off course?

Thanks,

2 replies

Forum|alt.badge.img+7
  • November 27, 2006
Hi,

All you need is just to put a Webservice Event in K2 Studio or add a webreference in Visual Studio and use DWS webservice (usually locates under _vti_bin/DWS.asmx) to create a new folder. This webservice contains a method CreateFolder which will create a folder in your library.

Regards,

Forum|alt.badge.img+4
  • December 26, 2006
u can also use the below code. K2 uses the same class to upload docs

K2SPSList SpsList = new K2SPSList();

if (! (SpsList.CreateFolder(DestSite.ToString(),DestFolder + "/" + Convert.ToString(K2.ProcessInstance.ID),ref ErrorMessage))) {
// Error Occurred in CreateFolder - Raise Error
throw new System.Exception(ErrorMessage);
}