0

I have created a custom New Item Form, and customized the Save button to redirect to the Display Form after submission. I asked a similar question, and it was gratefully answer by @Amal (here). The difference is that that works for the Edit Form, but not for the New Item form.

My Button:

<button class="btn btn-default" onclick="javascript: {ddwrt:GenFireServerEvent(concat('__commit;__redirect={https:my-url/Lists/AD_DB/newDisplay.aspx?ID=',@ID,'}'))}" name="btnSave">Save</button>

The issue is as I suspect that @ID is null at the moment of submission. What can I do to push the new item ID into the URL? Thanks!

1

You can use below JavaScript

fd.onsubmit(function() {
    var uri = fd.setUrlParam(decodeURIComponent(window.location.href), 'FDRedirectWithID', 'fd_Item_Edit.aspx?ID=');
    fd.sourceFormParam(uri);
    return true;
});

For more read this

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.