Page 1 of 1

Related items: child-grandchild

Posted: 06 Apr 2017
by Katy
Hi, I have a form based on three lists with parent-child-grandchild relations.
A - parent
B - child for A
C - child for B (grandchild for A)
I had the following scenario which works fine:
B is set up as a related item on the Edit form of A via non-grid related control. C is set up as a related item on a new B form populated via in-grid related control. In this scenario everything works fine: all the IDs are populated correctly.
But after the fist production run of the form business said I need to set up C the same way as B: populated via non-grid related control. I was trying to follow both instructions in these two articles (they are slightly different):
https://spform.com/related-items/creati ... ms-control
https://spform.com/documentation/relate ... gular-mode
But it doesn't work: the ID for C list item is just not coming up. Any help would be highly appreciated! Thank you!

Re: Related items: child-grandchild

Posted: 07 Apr 2017
by Dmitry Kozlov
Hi Katy,
I would not recommend you editing lists via two dialogs since by default SharePoint refreshes the main window after submitting a dialog even if it was a grandchild item.

But you can try getting parent's ID this way:
var parentID = fd.getSourceID();

Instead of this (this code retrieves an ID of the main window:):
var parentId = window.top.GetUrlKeyValue('ID');

Re: Related items: child-grandchild

Posted: 10 Apr 2017
by Katy
Thank you, Dmitry. I'll try to convince business that the table is fine :-)