we have the below requirement to be fullfilled

we have custom button which will save the form and redirects to allitems.aspx, but we need to save the item and navigate to the edit form with the newly created item id

how can this be achieved?

  • What do you mean by having a custom? How you are saving the form? SharePoint REST API or something else? How you are redirecting it to allitems.aspx? Are you using any custom code? If Yes, can you please add it to your question? – Ganesh Sanap Oct 16 '19 at 11:40
  • no custom code to save the item.. using hillibilly form and using OOTB save functionality to save the item to list – Pradeep Oct 16 '19 at 14:03

As per my understanding, You want to access the edit form once item has been created. for that you have to use redirect method in onQuerySucceeded method.

function onQuerySucceeded() {

    var itemId = oListItem.get_id();

    var listUrl = _spPageContextInfo.webAbsoluteUrl + "/Lists/YourListName/EditForm.aspx?ID=" + itemId;

    // Redirect
    window.location.href = listUrl;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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