Page 1 of 1

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

Posted: 05 Aug 2019
by Hnin Yu
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?

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

Posted: 05 Aug 2019
by mnikitina
Hello Hnin!

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

Do you open Child Item in the dialog?

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

Posted: 08 Aug 2019
by Hnin Yu
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?

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

Posted: 08 Aug 2019
by mnikitina
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);