Redirect to the new created item after submitting

  • 17 August 2015
  • 8 replies
  • 46 views

Badge +5

The redirect URL in the form can redirect the user to the required page but before assigning an ID to the created item, so the ItemURL has the ID = 0, is there a way to get the ID and redirect to the Display or the Edit page after creating the new item?


8 replies

Userlevel 6
Badge +16

Inside your form you could query the last ID used on the list, and then assume that your new item will be the read one + 1.

Badge +5

Thank you Fernando Hunth​ for your reply, but this way you are assuming that it is a single user solution.

There is another way, which is creating another middle page and query for the last ID by Created By current user, but I want to see if there is a better way.

Badge +11

What if the previous item was deleted Fernando Hunth​? It will show error.

Some one had asked a similar question earlier and encountered the same issue.

I dont know if this would work but you could submit the form using Javascript on the button and within this script, read the last ID created (max ID), and redirect the user (not sure how). happy.png

Badge +5

Kapil Joshi​, how to submit the form using JavaScript? Do you men read the form values and create the item via SP.js?

Badge +11

Correct.

See the reference below:

Jquery / Javascript Submit 2010 Nintex form

Nintex forms custom button submit AND redirect

Badge +5

Thank you Kapil Joshi​, but these samples are just simulating the click button event but none is returning the new item ID.

Badge +11

Osama Mourad

Following up on this old issue. Let us know your solution and mark it as correct to help others on the community.

Badge +5

Unfortunately the middle page is the best solution for this case.

And to solve the multiple users issue, I am checking the created by current user in the query.

So the full solution as a workaround is:

1. Set the form Redirect URL to a page with JS Webpart

2. The JS Webpart is querying the list every second with a please wait message waiting for an item created within seconds and created by current user.

3. Once the item retrieved it redirect the user to the form using the retuned item ID.

Reply