Cross Site Lookup

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Hubbaroo
Posts: 60
Joined: Sat Sep 21, 2013

10 Apr 2014

This code works and sets the correct ID in the cross site lookup fields depending on the originating parent form. The issue is when the code sets the ID for the lookup the lookup displays nothing. If I save the form and re-open it the data shows. It's as if I set the ID but the control will not show the data???

var parentID = fd.getSourceID();
var fromTitle = $('.ms-dlgFrame', window.top.document)[0].contentWindow.document.title;

if (fromTitle.indexOf("Relation")!=-1) {
fd.field('Catagory').control().value('Relation Maintenance Activity');
fd.field('Relation').control().value(parentID);
} else if (fromTitle.indexOf("Opportunities")!=-1) {
fd.field('Catagory').control().value('Opportunity Activity');
fd.field('Opportunity').control().value(parentID);
} else if (fromTitle.indexOf("Lead")!=-1) {
fd.field('Catagory').control().value('Lead Activity');
fd.field('Lead').control().value(parentID);
}


Thanks again.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

14 Apr 2014

Hello,

You can hide Cross-site Lookup field from the child form or put the parent ID with the display value:

Code: Select all

fd.field('Lead').value(parentID + ';#Display value');

Hubbaroo
Posts: 60
Joined: Sat Sep 21, 2013

16 Apr 2014

Perfect, Thank you!

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 19 guests