2

Can anyone explain how to properly pass the list item ID in a url when redirecting the url from a form action button? Here's my url:

onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={../../_layouts/ IniWrkflIP.aspx?List={fbaaa67e-2560-4c1e-a9d3-e6331d745522}&ID={@ItemId}&TemplateID={10a14bcf-f3ee-4b20-a92a-2d4bbeebb81c}')}" />

1

If you are talking on a NewForm page, the @ID won't be defined yet so you can't use it in a redirection url. You'd need a script that submits the data, queries for the ID with the information submitted then do a redirect. Fortunately there is a jQuery solution to do that in the SPServices library, SPRedirectWithID.

If you are on a View or Edit page, you'd use @ID.

  • I've tried that method from the edit form, but receive a correlation error. Any reason why that would throw an error? – user18217 Sep 23 '13 at 12:02
  • And when I get it to work, it redirects me to the dispForm.aspx of the last item created. Thoughts? – user18217 Sep 23 '13 at 19:55

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.