Create Document Sets with Javascript COM - Sharepoint 2010

I am trying to work out if it's possible to create Document Sets in a list using the Javascript COM.
If it is possible does anyone have an example of how to do it. I am using Sharepoint 2010.
Many thanks.

Hi,
after long seeking I found this solution:
SPController.prototype.createTestDocumentSet = function(){
        if(this.clientContext === null) {
alert("Share Point couldn't be loaded.");
return false;
        var item = null;
        var oList = this.clientContext.get_web().get_lists().getByTitle('ListName');
        this.clientContext.load(oList);
        var itemCreateInfo = new SP.ListItemCreationInformation();
        itemCreateInfo.set_underlyingObjectType(SP.FileSystemObjectType.folder);
        itemCreateInfo.set_leafName('Haliluja Doc Set');
        item = oList.addItem(itemCreateInfo);
item.set_item("ContentTypeId", "0x0120D520");
        //item.set_item('ContentType', 'Document Set');
        item.set_item('Title', 'Haliluja Doc Set');
        item.update();
        this.clientContext.load(item);
        this.clientContext.executeQueryAsync(function(){console.log("doc set created!");}, function(sender,args){console.log("keep working... "+args.get_message());});

Similar Messages

  • Create Document Set with custom Create Only permission set

    Here is the situation. We have a requirement where my customer wants to create document sets, however, document set/document level permissions are required.
    Setup: We created a new permission level called "Create Only". We then give the user Read and Create only permissions. This allows the user to theoretically create the item. We then run a Workflow on create that Replaces the permissions so that
    you are only allowed to view the ones you created along with other security groups based on their choices in the metadata fields.
    This setup works PERFECTLY when using a List or Form Library.
    However, for the life of me I cannot get it to work for Document Sets. If I have the same setup, I get an Access Denied message. However, it still creates the document set.
    What is weird, I've been playing around with custom permission levels and it seems as though the user has to have EDIT permissions at a minimum in order to create the document set. This will not work for me since I dynamically assign permissions to each
    document set based on what they select.
    As a side note, the only tool I have at my disposal is SharePoint Designer 2010.
    Does anyone know if there is an actual requirement to have EDIT permissions when creating a Document Set? Any input would be greatly appreciated.
    Alternatively, is there a way to setup permissions on a library for all NT Authenticated users so that we can give them the necessary permissions to create the Document Set, but still prevent them from see the other items and then the Workflow would set
    the permissions accordingly?
    I believe the more granular the permissions it uses those permissions instead so would this work?  I have not tested this theory yet.

    Hi,
    According to your description, my understanding is that you want to know if there is an actual requirement to have EDIT permissions when creating a Document Set and is there a way to setup permissions on a library for all NT Authenticated users and prevent
    them from seeing items created by others.
    For the first question, per my knowledge, if a user is given the Add Items permission, he/she can create a document set in SharePoint.
    However, there is an error “access denied” after the document set is created. It is due to the user has no permission to access the page which SharePoint will redirect the user to after finishing creating the document set.
    If the user is also given Edit Items permission, there will be no error when he/she create a document set.
    For the second question, I recommend to follow the link below to
    customize item permissions for each document submitted to a document library and remember to give the
    NT Authenticated users contribute permission.
    http://blogs.technet.com/b/spke/archive/2010/04/09/configure-item-level-permissions-for-document-libraries-sharepoint-2010-edition.aspx
    To grant permission to NT Authenticated users, please refer to the link below:
    http://office.microsoft.com/en-in/sharepoint-server-help/what-happened-to-add-all-authenticated-users-HA101805183.aspx
    Best regards.
    Thanks
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How to stop indexing certain set of documents in Fast search for sharepoint 2010

    Hello
    Can someone help me to understand how to drop documents with the state as archived at the time of indexing, i meant how to stop indexing those documents in fast search for sharepoint 2010.
    Shweta
    Me

    Have you tried adding it to the exclude list?
    Include a file type in the content index (FAST Search
    Server 2010 for SharePoint)
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • Create document set by workflow based on external list

    Hello,
    I'm wondering if the following is possible:
    I have a external list with all my projects.
    Next to that i have an document library where i place all the documents about the projects in document sets. Is it possible to automatically create the document sets based on the external list?
    So when a new record is created in the database (External list) it automatically creates a document set. (The document sets have an external data column which refers to the projects external data)
    I was thinking of an workflow, but i don't know how to accomplish this. I'm just a beginner with SharePoint.
    Kind regards,
    Robbert-Jan

    Hi Robbert ,
    According to your description, my understanding is that you want to create a document set for an external list in SharePoint 2013.
    For achieving your demand, you can refer to the article:
    http://msdn.microsoft.com/en-us/library/ff394479(v=office.14).aspx
    http://blogs.msdn.com/b/chandru/archive/2013/08/10/sp2013-creating-document-set-using-workflow.aspx
    One thing to notice is you cannot associate workflow with External List because workflow engine cannot run on back end system.
    Reference:
    http://siddiq-sharepoint2010.blogspot.in/2011/12/bussniess-connectivity-services.html
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Connect document set with document library

    Suppose you have a document set and a document library and they both have a column "PersonalID".
    How is it possible to connect a document set with a document library where you only see the documents with the same value in "PersonalID"?

    Hi Cameron,
    I created two content types where one is the parent of the other.
    I tried to use the filter but I can't choose any option. they are all greyed out.
    If I want to use connection on my document set properties web part, it's impossible. "Connections" is greyed out and I can't check it in the properties of the web part. If I check the box and save it, it's unchecked when I re-edit the web part.
    If I go to my list web part, I can't connect with another list, only with the image of the document set. "Send Row of Data To" > Image.
    I can't use "Get filter values from"...
    any tips/ideas?

  • Uploading Multiple Documents To a List Item sharepoint 2010

    hi Guys ,
    Is there a way we can enable (out of the box )Uploading Multiple Documents To a List Item sharepoint 2010 ?
    cheers

    No, There is no OOB way to do the same you have to build a custom Page/Control OR customise OOB Form to attache multiple files and that will be through integration of ajax based control (multiple file uploader.)
    the other way to do the same is provision a custom field. we have done this for our many  clients.
    Hi, I also encountered the same problem, could u pls provide detailed information by a custom field?

  • How to create caracter set with reference(or create it anyhow)on 5.0

    I have difficulty (only on version 5.0 and 4.7) to create caracter set with reference(or create it anyhow). On version 4.6 there is no problem (I can do that like described in course BC305).
    Transaction "spad"->Full administation-> character set->change-> character
    set-> character set->create using template(or just create)
    I have intention to modify char set afterwards
    How could I do that in version 5.0 ECC?

    and therefore in this forum with minor chances to get an answer.
    regards
    Peter

  • To create caracter set with reference(or create it anyhow) on 5.0ECC

    I have difficulty (only on version 5.0 and 4.7) to create caracter set with reference(or create it anyhow). On version 4.6 there is no problem (I can do that like described in course BC305).
    Transaction "spad"->Full administation-> character set->change-> character
    set-> character set->create using template(or just create)
    I have intention to modify char set afterwards
    How could I do that in version 5.0 ECC?

    and therefore in this forum with minor chances to get an answer.
    regards
    Peter

  • SharePoint 2013 REST Create "document set" folder

    Hi,
    Is there a way in rest api model to create a "document set" folder into a Library?
    I have already created a folder through this code :
    body: { '__metadata': { 'type': 'SP.Folder' }, 'Name': 'New name' }
    Do i need to use another namespace ? Or do i add new properties into the body section ?
    Regards.

    Hi,
    you could see below a part of my code which works : a CRM's plugin create a document set on a SharePoint online document Library.
    I have to use the "/_vti_bin/listdata.svc" instead "_api". Don't forget to add the "Slug" header.
    try
    Uri spSite = new Uri(https://contoso.sharepoint.com/sites/MySite);
    SpoAuthUtility _spo= SpoAuthUtility.Create(spSite, "[email protected]", WebUtility.HtmlEncode("pwd"), false);
    var formDigest = _spo.GetRequestDigest();
    headers = new Dictionary<string, string>();
    headers.Add("X-RequestDigest", formDigest);
    headers.Add("Slug","https://contoso.sharepoint.com/sites/MySite/Projects/MyDocSetName|0x0120D520007A233E5B7896684DA77F0B084D0FE117">https://contoso.sharepoint.com/sites/MySite/Projects/MyDocSetName|0x0120D520007A233E5B7896684DA77F0B084D0FE117");
    restQuery = "/_vti_bin/listdata.svc/Projects";
    url = new Uri(String.Format("{0}/{1}", _spo.SiteUrl, restQuery));
    byte[] data = System.Text.Encoding.UTF8.GetBytes("");
    // Send a json odata request to SPO rest services byte[] result = HttpHelper.SendODataJsonRequest(
    url,
    "POST", // reading data from SP through the rest api
    data,
    (HttpWebRequest)HttpWebRequest.Create(url),
    _spo, // pass in the helper object
    headers
    catch (FaultException<OrganizationServiceFault> ex)
    throw new InvalidPluginExecutionException(ex.Message.ToString());
    Regards.
    Gilles Martinez
    Twitter
    Blog
    Please mark as helpful/answer if this resolved your post

  • Create document set using ECMA Script

    Hi,
    I want to create a document set in SharePoint 2010 document library where i have already included document set content type.
    Is there any way to create a document set using ECMA Script?? If yes, then please provide the sample code for this...
    Thanks.
    -Prashant

    Hi Prashant,
    Although this post is aimed at SP 2013 and the App model, it should give you the object model references you need to complete your goal:
    http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom.aspx
    In particular the following function should be of use:
    function CreateDocumentSet() {
    var ctx = new SP.ClientContext("http://yourSharePointSite");
    var parentFolder;
    var newDocSetName = $('#txtGetDocumentSetName').val();
    var docSetContentTypeID = "0x0120D520";
    var web = ctx.get_web();
    var list = web.get_lists().getByTitle('DocSetLibrary');
    ctx.load(list);
    parentFolder = list.get_rootFolder();
    ctx.load(parentFolder);
    var docsetContentType = web.get_contentTypes().getById(docSetContentTypeID);
    ctx.load(docsetContentType);
    ctx.executeQueryAsync(function () {
    var isCreated = SP.DocumentSet.DocumentSet.create(ctx, parentFolder, newDocSetName, docsetContentType.get_id());
    ctx.executeQueryAsync(SuccessHandler('Document Set creation successful'), FailureHandler("Document Set creation failed"));
    }, FailureHandler("Folder loading failed"));
    ctx.add_requestSucceeded(function () {
    $('#txtGetDocumentSetName').val('');
    alert('Request Succeeded');
    ctx.add_requestFailed(function (sender, args) {
    alert('Request failed: ' + args.get_message());
    // Failure Message Handler
    function FailureHandler(message) {
    return function (sender, args) {
    alert(message + ": " + args.get_message());
    // Success Message Handler
    function SuccessHandler(message) {
    return function () {
    alert(message);
    Keith Tuomi | Twitter: @itgroove_keith | Blog:
    http://yalla.itgroove.net
    Please click "Propose As Answer" if a post solves the problem or "Vote As Helpful" if a post has been useful to you.

  • Help Required - Upload Multiple Documents functionality sometimes disappears in SharePoint 2010

    Hi All,
    We have a web application created in SharePoint 2010 & there we were facing an issue of not able to Upload multiple documents. After doing search on google, we have found that
    pre-requisites for this functionality to be working properly are as follows:
    Client Integration needs to be enabled for the web application.
    The STSUpld.UploadCtl IE add-in must be enabled. (located in C:\Program Files (x86)\Microsoft Office\Office12)
    The 32 bit version of Internet Explorer. The 64 bit version does not support it and neither do other, non IE, browsers.
    Office 2003 or newer on the client.
    After meeting all the above requirements, We are now able to see the Upload Multiple Documents link but we are failing in below 2 scenarios:
    On some machines it is working fine & on some it is not.
    On some machines, this option is available for sometime & sometimes it disappears.
    If any one of you have experienced the same problem, then please help us with your valuable suggestions & possible solution for it.

    Hi Manish,
    We've just been experiencing your initial issue with Office 2007 clients not being able to use the multi-file upload functionality.  Sure enough....turning on presence information in Central Admin fixes the issue.  The strange thing is though that
    when presence is turned off, Office 2003 and 2010 clients still work fine and it's only 2007 clients that fail.  Also this issue appeared to only exist for us inside applications that have been upgraded from MOSS2007 to SP2010.  Any new applications
    of even new site collections within an upgraded application worked fine across all 3 Office versions.
    Coincidently, we're also experiencing the more recent issue you've come across with files not uploading after clicking OK in the ActiveX.  Nothing happens.  Office 2010 clients work fine but 2003 and 2007 clients just don't upload the selected
    files.  We've found a workaround which "fixes" the issue but brings it's own set of problems so it's not ideal.  Here's what we've done...
    1. Open IIS, and navigate to the web where you want to use multi-file upload
    2. Select Handler Mappings and Add Script Map
    3. Set Request Path - shtml.dll
    4. Set Executable - C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\SHTML.dll
    5. Set the name to something meaningful - Multi File Upload
    6. Leave the Request Restrictions as default
    This should fix the issue with files not uploading but unfortunately it also prevents SharePoint Designer from accessing the site.  For the application where we desperately need multi-file upload we can manage without SPD access so it's not the end
    of the world but not ideal.  We've actually got an outstanding incident logged with Microsoft to resolve this issue but they've yet to find a solution for us.  We suggested to MS that we update authentication to Kerberos from NTLM and retry as we
    seem to be getting 401 errors in the call stack so thought that could be related.  We've not yet configured Kerberos so I'm not sure whether this is a solution or not.
    One other point worth mentioning is that SharePoint Designer 2010 (which is free) installs the latest version (14) of the Upload ActiveX and with this installed the uploads work as expected.  Also if you have Silverlight and SPD2010 installed then you
    get a Silverlight control to do the upload which also works fine.  Again, not ideal as rolling out SPD 2010 to affected clients isn't really a suitable solution.
    Sorry I can't be any more help.  Hopefully my findings might point you in the right direction.  If you do find a solution (other than the IIS handler mapping) then please re-post here,
    Good luck,
    Ben

  • Using JavaScript in SharePoint 2010

    I have an ASPX page using C# contained in a PageViewer Web Part in SharePoint 2010.  I have JavaScript used in the page that works when I run the page alone in IE 9, however when contained in a PageViewer Web Part, the JavaScript on the page does
    not work.  I have tried putting the JavaScript into a separate .js file and referencing it in the ASPX code, and putting the JavaScript file in the document library and referencing that in ASPX which did not work.  I know how to add the JavaScript
    into a Content Editor Web Part, however I do not have any idea how to get that to interact with the ASPX page to tell it the JavaScript is in the ASPX page.  Any ideas how to get my JavaScript to work in my scenario?

    This normally depends where you position the CEWP.  At the bottom of the page is usually a safe bet.
    Do you have permission to add CodePlex stuff (as a site collection admin)?  One of the projects that'll help you out is called JEFS (JavaScript Editor for SharePoint) and it was written for exactly the reasons you've experienced.
    The CodePlex link is http://jefs.codeplex.com/
    And I've recently written a review on it here:
    http://social.technet.microsoft.com/wiki/contents/articles/22658.the-codeplex-corner-javascript-editor-for-sharepoint-jefs.aspx
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Create Document Sets from template

    Our current functionality:  a document library is saved as a template.  When a user creates a new document library they created it from that template.  This ensures that all new document libraries consist of a pre-defined set of documents
    as a starting point.
    I'm looking into a Document Set solution.  My question is:  Is it possible to create a Document Set based on either an existing document set or an existing document library?  Basically, we have an initial set of documents that we would like
    to be included in all the new Document Sets created.  If they cannot be added at the time of creation, what would a power user need to do so that after an empty document set is created they would add a pre-defined set of documents from some other location
    in Sharepoint.  Basically, what I'm asking, is there something for Document Sets that is equivalent to:
    - exporting a document library as a template (with content)
    - creating a new document library based on that template
    except that I want to find out if something like this is possible for Document Sets
    thanks,

    What's a data set?
    For document sets you can create a custom content type and specify the default documents, metadata and so on. You can then use the Content Hub tooling to push that down to various subscriber site collections.

  • How to create a custom Contacts list in SharePoint 2010 from accounts already in AD

    Hi folks,
    Newbie to SharePoint but not to being an Administrator.  Problem is that in my new functions I no longer am an Admin.
    I have been asked to post contact lists (Excel) on the SharePoint site.  (fairly easy to do)
    But I though....we already have these people in AD and the GAL
    Why can't I just import what I want only and display that in SharePoint.
    I assume this is possible?
    I do not have SharePoint designer nor any programming experience....so no coding for me.
    Running SharePoint 2010 and Outlook 2010
    Can anyone guide me or give me info on how to do this?
    I do not want everyone in the AD/GAL.  Just some specific names with their contact info

    Hi,
    Please check this
    http://beyondweblogs.com/update-user-profile-in-sharepoint-programmatically/

  • Document Set with mysteriously disappearing files

    I am having issues trying to figure out what is wrong with my
    document set. It is inside of an approval library and I had just approved all
    the items within the set as well as the set itself. Then when I came back to the
    set later, all the items were missing. I could see them while looking through
    the explorer view but not in sharepoint.
    Any idea what the issue here is?

    Hello,
    Can you verify if there is any custom view on your SharePoint library which is preventing the Documents to be excluded after approval?
    Thanks & Regards,
    Kamlesh | Blog |
    Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.

Maybe you are looking for

  • Problems trying to RMA a product..

    "Problems trying to RMA a product..g I own the Soundblaster Arena Surround sound gaming headset, which I purchased two months ago... The USB connector on my headphones has been loose since I received it. I have always had to wiggle it around to get i

  • Make a Reference Quicktime Movie using QuickTime API for windows?

    Hi all, Does anyone know how to generate or modify a QuickTime Reference file? I try to generate a QuickTime reference file (.mov) that will point to external video clip Avid OpAtom such as \Avid MediaFIles\MXF\V1.mxf, \Avid MediaFIles\MXF\A1.mxf, \A

  • What is the iPod file that stores ratings?

    All i want to know is what is the file on the iPod that stores the ratings for the songs? I don't think that the ratings get stored on each individual song file as when you transfer them back to the computer they simply disapear along with the song c

  • S205 - Camera image is VERY red!

    I started using the built-in camera on my S205 with Skype this week (the first use ever, with any application), and the color is very, very red. So far, the only color adjustments I have located have been via the Cyberlink YouCam app (ver. 3.1.3623 -

  • Where we can set the Multi lingual support in BW system and Info Object?

    Where we can set the Multi lingual support in BW system and Info Object?