vLookup Relative URL (link to parent from child)

Forums Classic DFFS vLookup Relative URL (link to parent from child)

Viewing 13 reply threads
  • Author
    Posts
    • #25445
      Paul Lynch
      Participant

      Hi Alex,

      Starting to build a new form and use vLookup and very rusty.

      Setup my Parent and Child and all working great.

      ISSUE – Looking to prepopulate a HyperLink field in my child form, which links back to the original record (uses the ID column) and a URL string.

      Please attached image for my config and what I get. Which is the URL, but no ID. I am not sure what parameters to set to get the right result.

      The result of this is I get exactly the below URL without the actual ID number just [id].

      https://jnj.sharepoint.com/teams/gcoiti/Lists/Parent/DispForm.aspx?ID=[id]

      So what do I need to change to put the parent’s ID in the URL?

      PS – would be nice if there is a way that I could populate the description field separately too (with a fixed phrase like “click to see more details”)

    • #25447
      Paul Lynch
      Participant

      sorry forgot the attachment!

      Attachments:
    • #25468
      Alexander Bautz
      Keymaster

      Hi,
      I see that the text in the help dialog is a bit ambiguous, but what I meant to write is to use ItemRelURL in the From field and this will give you the correct relative path to the item.

      Unfortunately you cannot set the text part of the URL field directly, but you should be able to use something like this in your child form NewForm (in Custom JS):

      jQuery("#dffs_LinkToParentItem input:first").val("click to see more details");

      Replace LinkToParentItem with your field internal name.

      Alexander

    • #25554
      Paul Lynch
      Participant

      Thanks for this info!

      Sorry to piggy back this thread – but my vlookup table (in the parent form) is suddenly no longer rendering/appearing, just disappears as it loads.

      The child items are still being created though.

      I’ve tried re-creating the vlookup but no luck.

      I’ve remove any and all CSS in DFFS, on the page, and stripped back all settings to very basics? (there is no jquery either I could not get your code above to work). I also removed all the pre-populated child fields.

      Is there a way I can debug/troubleshoot this?

      • This reply was modified 4 years, 9 months ago by Paul Lynch.
      • This reply was modified 4 years, 9 months ago by Paul Lynch.
    • #25563
      Alexander Bautz
      Keymaster

      Sounds strange – do you have any custom function calls in the vLookup configuration? – I’m not sure how this could break it though, but you never know.

      Try inspecting the placeholder where your vLookup table should have been (right click > inspect) and look in the HTML to see if it is still there, but somehow hidden.

      You can use vLookupDebug=1 in the url like this to see that the script actually runs:

      .../Lists/DFFS_TestList/DispForm.aspx?ID=51&vLookupDebug=1

      Alexander

    • #25583
      Paul Lynch
      Participant

      Thanks! With the help of the debug it became clear it was something to do with the Prefill values in child as it was returning 0 results because the parentID field was not being populated, so no results were appearing.

      Now working (sorry changed so many things at once before working I cannot say exactly what I did wrong to help future users).

      Below is the final piece of the jigsaw to get this form ready..

      jQuery("#dffs_LinkToParentItem input:first").val("click to see more details");

      Replace LinkToParentItem with your field internal name.

      My steps:
      1. My prefill child works (ItemRelURL, and it prefills a relative link which is accurate.

      2. This relative link (format /teams/gcoiti/Lists/Parent/DispForm.aspx?ID=8 goes into a multiline of text rich text field. But it does not appear as a link just text. Should I use another column type?

      3. This column has internal field name of “Linktoform”

      4. I go into the child DFFS settings, and in the custom tab I entered

      jQuery("#dffs_Linktoform input:first").val("click to see more details");

      5. But still the none clickable Relative URL shows up in the column Linktoform (in list view which is ideally where I want to show it) and child item display form (which is not so important)

      Wondering if I could get bit more help to make this work?

    • #25589
      Alexander Bautz
      Keymaster

      If you want to write a link to a multiline rich text field you must write it like this to make it clickable:

      setFieldValue("Linktoform","<a href='/teams/gcoiti/Lists/Parent/DispForm.aspx?ID=8 '>Clickable part of the link</a>");

      Alexander

    • #26676
      Andreas Blüher
      Participant

      I feel like I’m trying to achieve the same thing as Paul, but I still can’t get it to work. I’m suspecting writing ItemRelURL to a url/hyperlink field is not possible?!

      I’ve set “from” to ItemRelURL and “to” to TicketLink which is my internal fieldname for the url column. However I’m getting the following error in chrome developer tools

      Error: Syntax error, unrecognized expression: /sites/mysite/lists/mylist/DispForm.aspx?ID=69

      • #26685
        Alexander Bautz
        Keymaster

        Hi,
        I tested this now and it works in my setup, but I think there was a bug related to setting a hyperlink field like this in the Prefill values in child section in a previous version – which version of DFFS / vLookup are you running?

        Alexander

    • #26712
      Andreas Blüher
      Participant

      Hey Alexander,

      I thought I had used the newest version, but I most likely deployed a branch without dffs 4.4.4.+

      I just tested it again and it’s working as expected.

    • #26714
      Andreas Blüher
      Participant

      One more question is there a way to get the editform url directly?

    • #26722
      Alexander Bautz
      Keymaster

      Sorry, but this is not built in. I can see if I can add it in the next release.

      Alexander

    • #26725
      Andreas Blüher
      Participant

      That would be much appreciated!

    • #26921
      Andreas Blüher
      Participant

      Hey Alexander,

      I just saw the new EditFormUrl thingy. Thank you for implementing it so fast!

    • #33466
      William Ellis
      Participant

      Is it possible to get the Parent Disp form to open in Dialog mode? Perhaps adding the ?=IsDlg=1 to the end of the ItemRelURL?

      Also, the jQuery is not working to edit the text of the link. I put this in the Customjs tab of the child New form but nothing happens.

      jQuery(“#dffs_InitiativeURL input:first”).val(“Link”);

      Is there something I need to put somewhere to trigger this?

      Dynamic Forms for SharePoint v4.4.5.20
      vLookup plugin backend v2.2.161

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