0

Note: My SharePoint tenant is locked down and we don't have access to deploy apps and all development must lean OTB.

I'm building a solution where I need to have more than one edit form on a list of items. I've completed the process on four other lists but two of my lists have over 5000 items in them. Usually, I can browse, in SPD, from All Files > Lists > MyList : and see all the forms and views for that list. Then I can copy/paste an existing form to manipulate, give it a new name, and do the work I need to do. However, when I browse to one of the large list to see the files, SPD give me the list view threshold server error message.

Ok, fine, so I browse through Windows Explorer to the same location, but the folder appears to be empty, no files. If I paste a file there, it doesn't show when I refresh. I assume it simple failed without notification.

Fine! So I go back to SPD, and navigate through Lists and Libraries > MyList > Forms : and click the Edit Form button to create a new edit form. I get the dialog, complete the info, press ok, and I get the message "Could not save the list changes to the server."

So how can i create a new Edit Form for my list with over 5000 items? Is there any work around for this?

1 Answer 1

0

This is clearly a limitation of SPD. Which MS may never update even though it is a useful tool for us limited to middle tier development due to a locked down tenant and small budgets. However, I was able to find a workaround. Basically what I did was create a new ASPX page, copy in the default Edit Form code, change all the IDs, save the file, then use REST to move the file to the list root folder.

For anyone else who encounters this issue, here is my work around.

  1. In SPD, create a new ASPX page in the same site where your large list is and give it a good name. You'll want to set this now to what ever name fits your needs as you'll likely need a REST call to change it later.
  2. Open the form that you want to duplicate in SPD > List and Libraries > YOUR LIST > Forms > Edit in Advanced Mode (right click on form). You might get some messages about the list view threshold, simply click OK and wait for the page to finish loading.
  3. Copy all of the code from this form. Paste the code in a text file, maybe in Notepad and save a backup.
  4. In SPD, browse to your new ASPX page that you created in step 1, open and make sure that you are editing in advanced mode. I saved mine to the SitePages Library.
  5. DO NOT SAVE after this next action. Delete all the code in your new ASPX page and paste all the code from step 3.DO NOT SAVE. You must change the IDs. By default there will be three. One on the WebPartZone and two instances of the same GUID on the ListFormWebPart.
  6. Look or search for "<WebPartPages:WebPartZone" and locate the "id" attribute. Change the ID. You can change this to just about anything. Typically I prefer to just change one NUMBER higher or lower. So a 5 becomes a 6 or a 4 as it is highly unlikely that SharePoint would generate an ID that would be just one number different. That is the first ID that should be changed.
  7. Now search or look for "__WebPartId" and you should find the ID of the ListFormWebPart. If you have more than one WebPart then you'll need to change all of those IDs accordingly. As before, I prefer to keep the same structure of the ID/GUID. So I changed just one number, up or down. That is the second ID that you'll need to change. Make note of which number you changed as you'll need to do the same change a few lines down.
  8. Now you'll need to find "<ID>" in the ListFormWebPart properties that has the same ID as in step 7. The ID here will likely have a prefix of "g_" and all lower case. Once you have found this value, change the same number in the same way that you did in step 7. By default, this will be the last ID that you'll need to change. If you have other WebParts on the page that you want to keep, then you'll need to change those IDs as well.
  9. Now save your page and do any check-in/Approve/Publish as needed for your library setup.
  10. Browse to the home page of the site where you want to move your new form page to. You'll likely need Full Control or Site Collection Admin to perform the next action, I'm not sure as I have both.
  11. Once the homepage has loaded, press F12.
  12. At the top of the Developer Tools, find the Console tab. Click the Console Tab.
  13. At the bottom right you find a double up arrow, click that to expand the code area.
  14. Next paste in one of the following blocks of javascript depending on whether or not you are loading jQuery.

    //--------------------If your page does not load jQuery use this code, if you are already loading jQuery, use the second block

    SP.SOD.registerSod("jquery-3.1.1.min.js", "https://code.jquery.com/jquery-3.1.1.min.js");
    SP.SOD.executeFunc("jquery-3.1.1.min.js", "", function(){
    $.ajax({
    url: "ABSOLUTE-URL-TO-SITE/_api/web/getfilebyserverrelativeurl('/SERVER-RELATIVE-URL-TO-SITE/LIBRARY/NEW-FORM-PAGE.aspx')/moveto(newurl='/SERVER-RELATIVE-URL-TO-SITE/Lists/LIST-NAME/NEW-FORM-PAGE.aspx',flags=1)",
    type: "POST",
    contentType: "application/json;odata=verbose",
    headers: {
    "accept": "application/json;odata=verbose",
    "X-RequestDigest": $("#__REQUESTDIGEST").val(),
    "X-HTTP-Method": "POST",
    "If-Match": "*"
    },
    success: function(){
    console.log("Success");
    console.log(this);
    },
    error: function(){
    console.log("Failed");
    console.log(this);
    }
    });
    });

    //--------------------Use this code if your page already loads jQuery
    $.ajax({
    url: "ABSOLUTE-URL-TO-SITE/_api/web/getfilebyserverrelativeurl('/SERVER-RELATIVE-URL-TO-SITE/LIBRARY/NEW-FORM-PAGE.aspx')/moveto(newurl='/SERVER-RELATIVE-URL-TO-SITE/Lists/LIST-NAME/NEW-FORM-PAGE.aspx',flags=1)",
    type: "POST",
    contentType: "application/json;odata=verbose",
    headers: {
    "accept": "application/json;odata=verbose",
    "X-RequestDigest": $("#__REQUESTDIGEST").val(),
    "X-HTTP-Method": "POST",
    "If-Match": "*"
    },
    success: function(){
    console.log("Success");
    console.log(this);
    },
    error: function(){
    console.log("Failed");
    console.log(this);
    }
    });


  15. Change the URL paths in the code to your specific situation.
    1. ABSOLUTE-URL-TO-SITE
      This will be the full path to your site.
    2. /SERVER-RELATIVE-URL-TO-SITE/LIBRARY/NEW-FORM-PAGE.aspx
      This will be the server relative path to the New ASPX page you created in step 1
    3. /SERVER-RELATIVE-URL-TO-SITE/Lists/LIST-NAME/NEW-FORM-PAGE.aspx
      This is the server relative path to the list that you want to move your New ASPX to.
  16. With the correct URLs set in the code, look in the bottom right where the double up arrow is, you'll find a green arrow, click this to execute the code.
  17. To verify, go back to your list in SPD > List and Libraries > YOUR LIST > Forms. You may need to refresh to see your form.
  18. Now you can edit this page in the WebUI or use JSOM to implement any necessary customizations as needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.