Following: SharePoint2013 form with related items list
I am trying to follow the instructions on "SharePoint 2013 form with related items list".
On the parent form I have this code:
var wp0 = $('div[id^="MSOZoneCell_WebPartWPQ"]:eq(0)');
wp0.detach().appendTo('#fd_tabcontrol-0-tab-1');
var newItem = wp0.find('.ms-list-addnew a');
var queryString = SP.ScriptHelpers.getDocumentQueryPairs();
newItem.attr('onclick', 'NewItem2(event, "' + newItem.attr('href') + '&expense=' + queryString['ID'] + '"); return false;')
When I view the form source the "new item" href has the following value: NewItem2(event, "http://share.showprg.com/_layouts/15/li ... expense=10"); return false; On the child (New Form) I have the following code: var queryString = SP.ScriptHelpers.getDocumentQueryPairs(); fd.field('Expenses').control().value(queryString['expense']); However I never get the value in the "Expenses" lookup field. What am I doing wrong here? Thanks, Marion
On the parent form I have this code:
var wp0 = $('div[id^="MSOZoneCell_WebPartWPQ"]:eq(0)');
wp0.detach().appendTo('#fd_tabcontrol-0-tab-1');
var newItem = wp0.find('.ms-list-addnew a');
var queryString = SP.ScriptHelpers.getDocumentQueryPairs();
newItem.attr('onclick', 'NewItem2(event, "' + newItem.attr('href') + '&expense=' + queryString['ID'] + '"); return false;')
When I view the form source the "new item" href has the following value: NewItem2(event, "http://share.showprg.com/_layouts/15/li ... expense=10"); return false; On the child (New Form) I have the following code: var queryString = SP.ScriptHelpers.getDocumentQueryPairs(); fd.field('Expenses').control().value(queryString['expense']); However I never get the value in the "Expenses" lookup field. What am I doing wrong here? Thanks, Marion
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Please, download and install the latest version of Forms Designer (2.7.5). It allows you to add related items directly in Forms Designer. We will publish the detailed documentation soon and I will put the link into this thread.
- Clint Lechner
- Posts: 5
- Joined: Wed Aug 28, 2013
Hmmm, so Sharepoint isn't loading SP.Scripthelpers library. Is that typically loaded? I have 2.7.5 installed.
I actually have the same problem. Verified a few times everything was correct but ultimately the console throws this javascript error --
Uncaught TypeError: Cannot call method 'getDocumentQueryPairs' of undefined
Hmmm, so Sharepoint isn't loading SP.Scripthelpers library. Is that typically loaded? I have 2.7.5 installed.
I actually have the same problem. Verified a few times everything was correct but ultimately the console throws this javascript error --
Uncaught TypeError: Cannot call method 'getDocumentQueryPairs' of undefined
Hmmm, so Sharepoint isn't loading SP.Scripthelpers library. Is that typically loaded? I have 2.7.5 installed.
- Clint Lechner
- Posts: 5
- Joined: Wed Aug 28, 2013
Whoops, I read your message above wrong. So it's implemented now? Can't wait to see the documentation. Well done!
- Jeff Childers
- Posts: 18
- Joined: Sun May 25, 2014
Is it possible to modify the New Item link in the related items section. If so, could you please include that documentation as well. I would like pre-fill the child list with the lookup column value that I filter the related item list with.
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
-
- Information
-
Who is online
Users browsing this forum: No registered users and 23 guests