Save and redirect in button

Good day,
Can i save new item at button click and redirect to edit form ?
i tried something from forum, no luck..

Hello @ixxxl,

You can find the code sample in our documentation here:
Redirect users to edit form after submition

@mnikitina
Hello, i tried this , nothing happens, no errors

fd.spSaved(function(result) {
    var listId = fd.spFormCtx.ListAttributes.Id;
    var itemId = result.Id;

    //replace "https://domain.sharepoint.com/sites/sitename/subsite" with path to your site
    //PageType=6 means Edit Form
    result.RedirectUrl =
        "http://intranet/procese/_layouts/15/listform.aspx?PageType=6&ListId="
        + listId + "&ID=" + itemId;
});

@ixxxl,

The URL looks strange, It should include sites like this:
http://intranet/sites/procese/_layouts/15/listform.aspx?PageType=6&ListId=

Please double check the url to the site.

@mnikitina
it's ok with url. it is a subsite in main site - http://intranet

image

image

and no alert

Hello @ixxxl,

If you want to submit the form on button click, please add return fd.save() code below your existing code.

1 Like