Following: SharePoint2013 form with related items list
Posted: 26 Aug 2013
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