Get ID on New Item Save

Forums Classic DFFS Get ID on New Item Save

Viewing 4 reply threads
  • Author
    Posts
    • #25862
      becca
      Participant

      Is there any way to get {ID} in newform to use in newform? I have emails setup to have a link in them along the lines of /site/list/DispForm.aspx?ID={ID} which worked like a charm in workflows, but I’m trying to use DFFS to replace as much workflow actions as possible since it’s quicker and more reliable. I tried to grab it in presaveaction, onbeforeunload, and onunload with no luck so far, is there any way at all to grab it to use in the email?

    • #25864
      Alexander Bautz
      Keymaster

      Hi,
      Unfortunately you don’t have access to the ID until after the form is saved. What you should do is to format your link like this (note that the form must have DFFS for this to work, and you must have a field in the list with FieldInternalName “_DFFSID”):

      <a href="{viewitemlink}">Link to item</a>

      This will give you a link like this:

      /site/list/DispForm.aspx?DFFSID=12345

      When you get to your DispForm, DFFS detects the DFFSID query string parameter and gets the correct item by a query and then reloads the page with the correct ID.

      Alexander

    • #25874
      becca
      Participant

      Awesome work-around, thanks.

    • #26063
      becca
      Participant

      So not sure what is up with this right now, when I last responded it took me directly to the item but now both view and edit are taking me to a list view filtered to only the item, or all items with the same name. I tried this on 2 separate sites and they’re both taking me to a list view now for links from new items, did I mess something up?

    • #26069
      Alexander Bautz
      Keymaster

      This is because you use an older version of DFFS. I don’t recall exactly when I changed this, but you find it in the change log.

      Alexander

Viewing 4 reply threads
  • You must be logged in to reply to this topic.