Related item: prepopulate second field, not ID

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Katy
Posts: 145
Joined: Wed Dec 02, 2015
Location: Canada

28 Dec 2016

I hame a related item on Edit form done with these instructions:

http://spform.com/office-365/crea ... office-365

And My ID is populating correctly without any issues. But i have another look up field from parent which i need to populate on new related item. How i can do that? I tryed fd.populateFields - no luck...

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

29 Dec 2016

Hi Katy,

If you're adding child items via a dialog, you can get parent's field values this way:

window.top.fd.field('FieldName').value()

Katy
Posts: 145
Joined: Wed Dec 02, 2015
Location: Canada

29 Dec 2016

May be i am not doing it right but this is not working. So let me explain once again:

I have two lists: main wit WeekID and EmployeeType field and child which is connected to main by WeekID and the Type field is an added column (it is shown in the list like WeekID:EmployeeType) . Yes, i am adding new items via dialogue so on new item child list form i have the following code:

var parentID = fd.getSourceID();


if (parentID) {


fd.field('WeekID').control().value(parentID);


window.top.fd.field('WeekID_x003a_EmployeeType').value();


$('.WeekID').hide();


}


WeekID - no problem with getting it, but WeekID:EmployeeType is just staying blank.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

30 Dec 2016

Hi Katy,

Try to output the Type:

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

what's the result. Is the Type field located and displayed in the parent form?

Katy
Posts: 145
Joined: Wed Dec 02, 2015
Location: Canada

02 Jan 2017

Thanks Dmitry. It gives "undefined" message.

Katy
Posts: 145
Joined: Wed Dec 02, 2015
Location: Canada

02 Jan 2017

And yes - 'EmployeeType' field from the parent list is also located on the form.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

02 Jan 2017

Hi,

Please, try to output the following:

alert(window.top.fd.field('WeekID_x003a_EmployeeType').control()._el().text());

Katy
Posts: 145
Joined: Wed Dec 02, 2015
Location: Canada

02 Jan 2017

Now the message is blank

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

02 Jan 2017

Are you sure that the field is not empty on the parent form? Could you provide HTML-source of the form? Drop it to support@spform.com.

Katy
Posts: 145
Joined: Wed Dec 02, 2015
Location: Canada

02 Jan 2017

Thanks, i sent it.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests