Related Item Creation on Parent New Form Problem

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
gaj
Posts: 40
Joined: Wed Feb 01, 2017

24 Oct 2018

Hi,
if I´m using your Code desc. here https://spform.com/documentation/relate ... gular-mode this works only for me if the parent List already has at least one Listitem.
If not (creating the first record in the parent list) the parent-id will not be set in the related Item New-Form (Dialog).
I´m using FD 3.1.5 with SPO

Thx for helping me.

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

25 Oct 2018

Hi!

So, I've checked it out, the Related Items functionality from the instruction below works fine, most probably you have some errors in the implementation.
Here is the list of the frequent errors can be encountered:
1) Check whether you replace ‘Parent’ with the internal name of the lookup field in the source in the JavaScript code snippets, here:

Code: Select all

fd.populateFieldsInGrid($('.related-items'), {
  Parent: '{CurrentItem}',
});
and here:

Code: Select all

if (window != window.top && window.top.fd) {
  // the form is opened in a dialog from the parent form
  var parentId = parseInt(window.top.GetUrlKeyValue('ID'));
  if (parentId) {
    // the form is opened from the Edit form
    fd.field('Parent').value(parentId);
  } else {
    // the form is opened from the New form
    $('#_fd_parent_temp > input').val(window.top.fd._tempParentId());
  }
   
  $('.parent-field').hide();
}
2) Check whether you switch CDATA property of the HTML-control to False.

Please try to make a brand new Related items implementation considering these subtle moments.

gaj
Posts: 40
Joined: Wed Feb 01, 2017

30 Oct 2018

Hi,

the problem only accur if the Lookupfield is a CrossSiteLookup and not a sttandard Lookup - Field!

How to set back a CrossSiteLookup to a standard Lookupfield.

thx for help

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

30 Oct 2018

Hi,

Don't you forget to reload DataSource for Related Items control after changing a Lookup to a CS Lookup? It works fine with CSL on my tenant.

If you want to revert from CS Lookup to Lookup, you just need to remove JSLink property.

Screenshot_79.png
Screenshot_79.png (11.59 KiB) Viewed 2141 times

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests