Submit and Continue

Forums Classic DFFS Submit and Continue

Tagged: 

Viewing 2 reply threads
  • Author
    Posts
    • #20616
      Bucci
      Participant

      It’s there any JS code to enable me open a new form either in new tab or modal, save and create a newform .aspx with items saved. E.g is having to enter multiple entry of 50 items that have 15 fields and in that, 14 fields will be the same data and only one field will change, so I dont need to enter all data 50 times.

    • #20618
      Keith Hudson
      Participant

      This is not a DFFS or javascript answer, but simply a reminder of some of the built-in capability of SharePoint that MIGHT meet your need, just in case you haven’t considered it.

      A.
      In a Quick Edit view of a SharePoint list (or in the Datasheet view in SharePoint 2007 and 2010), the last line displayed on each page in the view is a blank line. That line is a data entry line that can be used to enter a new record on the list.

      You can copy and paste from Excel into that blank line to enter multiple new items at once.

      In your example (50 new items each with 14 of the 15 fields on the list identical), you could create an Excel spreadsheet with 50 rows containing the 14 fields you need to repeat in each new record, and copy all 50 then paste them into the last row in a view of the list. Make sure that the field order is the same in both the Excel sheet and the view. Also, make sure the 15th field is not required, as you will be leaving it blank, then going back to finish filling that field in.

      B
      Change the list settings so the repeated information you want in each of the 14 fields is the default for that field. That way, when you open a new record, the 14 fields will populate with the desired information and you only need to fill in the 15th field.

      I don’t know your exact use case in detail, so it is possible that neither of these approaches will work for you, but I just wanted to make sure you are not overlooking a simple built in approach in case it will meet your needs.

    • #20620
      Bucci
      Participant

      I have a DFFS form that opens in modal and I want users to enter items and if they need to repeat some fields for the next item, they can select save and continue rather than saving and startin all over again. when save and contine is selected a new form will open with the previous saved fields so they can change the few fields they want to. In my case Users do not have access to the quick edit or list view

      • #20645
        Alexander Bautz
        Keymaster

        This is possible to build, but depending on the complexity of your form you might be able to use the method described here. What this code does, is to stop the built in save functionality in SharePoint and instead use custom js to submit the data as a new record in the list.

        You could change the redirect used in the example and instead add an alert box telling that the item was submitted, and that the use can edit and resubmit to create a new item.

        Change the code from this:

        ...
        ...
        if(newItem.success){
            url = location.pathname.substring(0,location.pathname.lastIndexOf("/")) + "/EditForm.aspx?ID="+newItem.id;
            if(GetUrlKeyValue("IsDlg")==="1"){
                url += "&IsDlg=1";
            }
            location.href = url;
        }else{
            alert(newItem.errorText);
        }
        ...
        ...

        to this:

        ...
        ...
        if(newItem.success){
            alert("The new record was successfully created. Edit the form and resubmit to create another record.");
        }else{
            alert(newItem.errorText);
        }
        ...
        ...

        You find more examples in the forum post linked from the above article: https://spjsblog.com/forums/topic/redirect-from-newform-to-editform-in-dffs/

        Alexander

Viewing 2 reply threads
  • You must be logged in to reply to this topic.