show look up data when new item is added in related item

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Hnin Yu
Posts: 14
Joined: Fri Jun 07, 2019

05 Aug 2019

Hello,

I have two lists in SP.List A has ID and site code (look up filed). List B has ID and site code (look up field).I make related item in List A and filtered by ID and Editable is True.
My question is
- When I click new item in List A of related items, auto show data in the site code field (look up field) in new item form.
According to attachment,
List A has site code is SHM00251
Can we auto appear that site code in new item form after clicking new item button?
Attachments
list A.png
list A.png (14.69 KiB) Viewed 5876 times
newitem.png
newitem.png (15.57 KiB) Viewed 5876 times

User avatar
mnikitina
Posts: 264
Joined: Wed Jun 05, 2019

05 Aug 2019

Hello Hnin!

Could you please clarify if the Site Code filed is the lookup field?

Do you open Child Item in the dialog?

Hnin Yu
Posts: 14
Joined: Fri Jun 07, 2019

08 Aug 2019

Hello,

Site Code is Look up field.
In List A, I open the form with site code (SHM00251).This is first photo.
Then, I click new item and then appear pop up form from List B .This is second photo.
I would like to appear site code (SHM00251) automatically without searching these site code (SHM00251) in look up field.
Is it possible?

User avatar
mnikitina
Posts: 264
Joined: Wed Jun 05, 2019

08 Aug 2019

Hello Hnin!

Please use the following code to set the lookup field in child item with the value from the parent lookup.

Please replace LookupParent and LookupChild with the internal names of the fields.

Code: Select all

var ID = Number(window.top.fd.field('LookupParent').value());
fd.field('LookupChild').value(ID);

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests