how can I add new Item with 2 parentID

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

19 Jun 2014

Hi,

Sure, you can pass it into openFormInDialog function:

fd.openFormInDialog('NewForm.aspx', {ParentID: GetUrlKeyValue('ID')})

craigwat11
Posts: 11
Joined: Thu Apr 24, 2014

20 Jun 2014

Thanks Dmitry, I've added this into my button onlclick script and the child form is opening etc but it's not auto-populating my Item ID field on the child form.

On the child form I am using:


var parentID = fd.getSourceID(); if (parentID) { fd.field('ItemID').control().value(parentID); $('.ItemID-field').hide(); }


I am probably being a little dim...?

craigwat11
Posts: 11
Joined: Thu Apr 24, 2014

20 Jun 2014

Figured it out:

var parentID = window.top.GetUrlKeyValue('ID');
if (parentID) {
fd.field('RAID').control().value(parentID);
$('.RAID-field').hide();
}

Boom :-)

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests