Related Items when parent is opened in Dialog

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
andyb
Posts: 25
Joined: Fri Oct 26, 2018

09 May 2019

Hi, I've been looking at https://spform.com/related-items/creati ... ms-control

In it, it outlines how to use a standard new form in the related items control to add new items, which works fine when my parent form is opened in a page, however, in some cases the parent form will be opened as a dialog. If this is the case, the code does not seem to populate the lookup field in the 'child' item.

Is there some way I can get this to work when my parent form is a dialog? I considered changing the reference of window.top to window.parent but that seems to make no difference and still fails to populate the lookup field.

Hopefully this makes sense! Please let me know if you need further information. I am using SharePoint 2013 server and Forms Designer 3.1.4.

Thanks
Andy

EDIT - I think I fixed it by adding this into the new form and setting the lookup field with parentId:

var parentId = $('.ms-dlgFrame', window.top.document)[0]
.contentWindow.GetUrlKeyValue('ID');

But please tell me if I'm doing this wrong! :)

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

09 May 2019

Dear Andy,

Please refer to more fresh documentation here: https://spform.com/documentation/relate ... gular-mode

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests