Related item: prepopulate second field, not ID

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
User avatar
2xdutchAZ
Posts: 7
Joined: Sat Jan 06, 2018

14 Jan 2018

Dmitry, how did this got resolved? I'm working on the same thing (and send you an email).
I actually get the value i'm looking for from the Parent in that Alert screen, but it does not populate on my child form still when I take out the Alert.

var parentID2 = fd.getSourceID();


if (parentID2) {


fd.field('RelatedCentralTask').control().value(parentID2);


alert(window.top.fd.field('REOmatchID').value());


$('.RelatedCentralTask').hide();


}

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

15 Jan 2018

Hello, Wouter!
I've already answered you in email, but just in case - this code should get the value from the Parent Item, just tested it myself:

Code: Select all

fd.field('Title').value(window.top.fd.field('Title').value());
Make sure to add this code to the Child form, not the parent form.
Cheers

Tanja1980
Posts: 2
Joined: Mon Jan 29, 2018

29 Jan 2018

Hello,

I have a similar problem - I've also done a related item but on New form and with these instructions:
https://spform.com/documentation/relate ... gular-mode

Populating one child field from parent works fine, however I also need a second one to be populated automatically from the parent and furthermore, I need both these lookup fields to be populated in other related items in different tabs too.

Can this even be done in FormsDesigner?

Image

Thanks,
Tanja

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

30 Jan 2018

Dear Tanja,
Populating two fields in Child should be easy, but is it really necessary here? I assume that you have two Lookups to Parent, but one of them looks up Parent ID/Title and another one is a lookup to Date, correct?

You can just use one field instead and select Date as an additional field in Child List -> List Settings -> Lookup Column:
Additional Fields for Lookup.png
Additional Fields for Lookup.png (5.08 KiB) Viewed 1777 times
This way you only need to populate one field. If you really need to populate both, that's also easy, just let me know and I'll help you do just that.
I need both these lookup fields to be populated in other related items in different tabs too
I am not sure what I completely get this, can you please provide me with a screenshot or a video with explaination of what you need? Otherwise, it's a bit confusing.

If there are other Related Items on Parent form, please, follow instructions for the other ones as well, simply give them a different class name and add all the necessary code.
Cheers

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests