Hello,
I am using the following code to create folders in a SharePoint 2013 document library based on a SQL database:
public class SPCreateFolder
{
public Folder CreateFolder(Web web, string listTitle, string fullFolderUrl, string ADLogin)
{
if (string.IsNullOrEmpty(fullFolderUrl))
throw new ArgumentNullException("fullFolderUrl");
var list = web.Lists.GetByTitle(listTitle);
return CreateFolderInternal(web, list.RootFolder, ADLogin != null ? fullFolderUrl + " - " + ADLogin : fullFolderUrl);
}
private static Folder CreateFolderInternal(Web web, Folder parentFolder, string fullFolderUrl)
{
var folderUrls = fullFolderUrl.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
string folderUrl = folderUrls[0];
var curFolder = parentFolder.Folders.Add(folderUrl);
web.Context.Load(curFolder);
web.Context.ExecuteQuery();
if (folderUrls.Length > 1)
{
var subFolderUrl = string.Join("/", folderUrls, 1, folderUrls.Length - 1);
return CreateFolderInternal(web, curFolder, subFolderUrl);
}
return curFolder;
}
}How can i amend the code to to write to other columns in the document library? I have an Active column (yes / no field) i would like to update.
Thanks in advance
Duane