Very simple but can be very daunting if its not implemented with the correct logic.
Use this code:
custLstObj.Folders.Add(parentFolderUrl, SPFileSystemObjectType.Folder, folderName);
Here's the details about the parameters
ParentFolderUrl: This is the url of the parent folder. For example if the folder is under main library then it should be '/lists/{listname}'
in case of sub folder this should be like '/lists/{listname}/{sub-fldername}'
SPFileSystemObjectType: Folder
folderName: actual name of the folder
if you use the 'Add' function with these parameters and perform 'UpdateOverWriteVersion' afterwards. The call to 'UpdateOverWriteVersion' function won't throw any exception.
Majid
I'm senior Developer/Consultant and passionate about Microsoft Technologies including Microsoft 365, SharePoint and .NET. I have been working in this industry for well over 10 years. This blog is all about sharing unique scenarios and tips of my project work which someone else might find handy too.
Subscribe to:
Post Comments (Atom)
Iconise ‘Add Picture’ control in PowerApps
Default look you get for ‘Add Picture’ control is not very appealing for end user and there is no OTB way of specifying icon for this con...
-
There's a very good article on business connectivity services which puts you on the right direction to start things with it. But when a...
-
Powershell command start-job does support running the script block under specified user. The command also supports various other feature w...
-
Popular SQL Grim - How to get around with it: After a long when when I tried to run Share Point on my laptop - rather me seeing the centr...
No comments:
Post a Comment