none
Sharepoint 2016 Custom Forms: Managing Multiple Custom Forms RRS feed

  • Question

  • Hello all,

    I am being asked to manipulate a live site on sharepoint 2016 on-premises. I have created a new custom new form (Form B) so i can tinker with it so I don't mess up the live new form (Form A).

    Problem is, when I add code to Form B, code for Form A is wiped and in Sharepoint Designer 2013, the form is not there anymore and Form B is now the new default, even though I did not set it as such. Why can't these two forms exist at the same time and keep wiping as the other comes into new code?

    Note: Both forms have very similar code since Form B is a copy of Form A that is being updated with new code for testing.

    Thursday, June 25, 2020 3:55 PM

All replies

  • Hi colt.coogs,

    Are the forms list form like below?

    Can you share more steps so that we can reproduce the issue?

    Thanks

    Baker Kong


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click  here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Friday, June 26, 2020 1:31 AM
  • Yes it is that page.

    if you make a new form, call it FormB and then copy all the code from NewForm.aspx into FormB.aspx. Then when you refresh SPD2013 then it should delete NewForm.aspx from that list and make FormB default. 

    You might need to new forms to make this happen, and have one as default first.

    The forms we work with is full of javascript so it might make a big difference.

    - Colton

    Friday, June 26, 2020 12:39 PM
  • Hi colt.coogs,

    I am able to reproduce this issue: copy the code to the new custom form, it will erase the original one. 

    And i do find a workaround:

    The newform.aspx file in fact is still there, we can directly make a copy of newform.aspx in "ALL Files" folder. 

    *Note: do not forget to rename the copy file since the form requires a valid name without special characters. 

    Best Regards,

    Baker Kong


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click  here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, June 29, 2020 5:56 AM
  • Yes, I realize the files stay there but if you copy customized code from one form to the other, the first page is emptied (so you go to a blank page) and the other work shows up correctly but it's made default and the other (which we need) is still messed up.

    So what I need to figure out is how to stop that from happening and have two similar forms function at the same time.

    Monday, June 29, 2020 2:48 PM
  • Hi colt.coogs,

    Could you please directly copy the file instead of the content of newform.aspx? Below is my test step:

    1, Add some custom code (JS+Html) into newform.aspx

    And you can see there are a lot of customized code in the file

    2, Copy the file and paste it in the same folder then rename it

    3, Refresh the list forms, the new custom form will appear

    4, Open this 2 forms to check their content. Check if the original one is empty or not.

    Result

    After that, you can customize the form from the copy. 

    Best Regards,

    Baker Kong


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click  here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Tuesday, June 30, 2020 5:14 AM
  • Don't currently have access to all files but I contacted my tech lead.

    In case he doesn't get back to me or I can't get access, would there be any other options?

    Also can you confirm that you can access the page of both sites and they work correctly with the current method?

    Tuesday, June 30, 2020 3:20 PM
  • If you are using Infopath to create the form - you can have specific views associated with it. One thing we created internally was a list of validators, and had a special view on the infopath form to check if current user's ID was on that list in Sharepoint. If that was true, then form loaded to a different view.

    So you would have to look at "Form Load" rules, and put in a condition to that data connection = where "if username() = UserID", switch to view: Validator.

    Hope this is a possible suggestion for you. I hope this helps you in SharePoint Migration.
    Tuesday, June 30, 2020 3:33 PM
  • Hi colt.coogs,

    Here I can access both forms in browser and they works well, you can check the result.gif in the former reply.

    Thanks

    Baker Kong


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click  here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.


    Wednesday, July 1, 2020 9:25 AM