Often, it might be necessary to redirect users to a specific form. You can just copy the URL of the opened form, or generate a URL based on these rules.
The structure of a form URL is:
var url = 'https://domain.sharepoint.com/sites/sitename/subsite/_layouts/15/listform.aspx?PageType=' + pageTypeNumber + '&ListId=' + listId + '&ID=' + itemId
the form type that you want to open:
8 is New Form
6 is Edit Form
4 is Display Form
listId is the ID of the List or Document Library to open, which can be copied from the URL of List/Library settings page:
itemId is the ID of the Item or Document to open.
A link can also be built with JavaScript and can be used in variety of situations. To redirect user after form submission to the next form, or to open form in dialog, for example.
Use the following code to build link while on a form:
var url = 'https://domain.sharepoint.com/sites/site/_layouts/15/listform.aspx';
//current item's Edit Form URL:
var params = {
PageType: 6,
ListId: fd.spFormCtx.ListAttributes.Id,
ID: fd.itemId
}
url += '?' + $.param(params);
console.log(url);
Dialog.open(url);
Now, you don’t have to get all these values with JavaScript, some, if not all, can be prepopulated depending on your scenario.