Home › Forums › Classic DFFS › vLookup Relative URL (link to parent from child)
Tagged: vLookup RelativeURL
- This topic has 15 replies, 4 voices, and was last updated 3 years, 6 months ago by Alexander Bautz.
-
AuthorPosts
-
-
May 24, 2019 at 14:05 #25445
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”)
-
May 24, 2019 at 14:06 #25447
sorry forgot the attachment!
Attachments:
-
May 25, 2019 at 13:33 #25468
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
-
June 3, 2019 at 14:22 #25554
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 5 years, 5 months ago by Paul Lynch.
- This reply was modified 5 years, 5 months ago by Paul Lynch.
-
June 3, 2019 at 17:08 #25563
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
-
June 4, 2019 at 10:36 #25583
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?
-
June 4, 2019 at 18:42 #25589
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
-
August 16, 2019 at 10:41 #26676
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
-
August 16, 2019 at 16:06 #26685
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
-
-
August 19, 2019 at 15:11 #26712
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.
-
August 19, 2019 at 15:13 #26714
One more question is there a way to get the editform url directly?
-
August 19, 2019 at 19:40 #26722
Sorry, but this is not built in. I can see if I can add it in the next release.
Alexander
-
August 20, 2019 at 07:47 #26725
That would be much appreciated!
-
September 2, 2019 at 08:05 #26921
Hey Alexander,
I just saw the new EditFormUrl thingy. Thank you for implementing it so fast!
-
May 14, 2021 at 14:01 #33466
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-
May 15, 2021 at 08:38 #33474
Hi,
This is unfortunately not possbile without using custom js because the modal dialog cannot be triggerend just by adding ?IsDlg=1 – see the syntax for a modal dialog here: https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ff410058(v=office.14)The text of the link is not in the first input, but the second – try using this instead:
jQuery("#dffs_InitiativeURL input:last").val("Link");
If this does not work, it might be because vLookup sets the value asynchronous and overwrites your change. If so, wrap it in this function to ensure it is triggered after it has been set by the vLookup code: https://spjsblog.com/vlookup-for-sharepoint/vlookup-user-manual/#vLookupPresetFromUrlDone
Alexander
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.