how can I add new Item with 2 parentID

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
eedoh
Posts: 37
Joined: Tue Feb 11, 2014

24 Mar 2014

Why don't you use cookies? Just make them available through the whole site (set path attribute to "/").

ON SOURCE FORMS!

var licID = fd.getSourceID();if (licID) { fd.field('licID').control().value(licID); $('.licIDhid').hide();}
document.cookie = "LICID="+licID +"; path=/";

var agremntID = fd.getSourceID();if (agremntID) { fd.field('agremntID').control().value(agremntID);
document.cookie = "AID="+agremntID+"; path=/";


ON TARGET FORM

var licID = document.cookie.replace(/(?:(?:^|.*;\s*)LICID\s*\=\s*([^;]*).*$)|^.*$/, "$1");
var agremntID = document.cookie.replace(/(?:(?:^|.*;\s*)AID\s*\=\s*([^;]*).*$)|^.*$/, "$1");

wdksa1
Posts: 7
Joined: Sun Mar 16, 2014

24 Mar 2014

Thank you verry much MR.Eedoh .. but could you please give an Example for (set path attribute to "/"). ?

I'm sorry I don't have that much of experince .. :)
thanks a lot ..:)

eedoh
Posts: 37
Joined: Tue Feb 11, 2014

24 Mar 2014

It's already there (ie. document.cookie = "LICID="+licID +"; path=/";). Just try the code I posted. I did not test it though, but you should be able to adjust it to your needs if it doesn't work with copy/paste approach :D

wdksa1
Posts: 7
Joined: Sun Mar 16, 2014

25 Mar 2014

I tray it but it didn't put the vaule in the invoce form . :)

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

25 Mar 2014

Hello,

I would recommend you to send the detailed requirements to our support service: support@spform.com. Also, please, provide them with a temporary access to your farm via RDP or TeamViewer. Based on this information we will estimate your assignment.

Dave Baldwin
Posts: 5
Joined: Fri Mar 03, 2017
Contact:

08 May 2014

I have a vary similar situation. In my case it is Patient -> Assistance -> Application

The application is linked to both the patient ID and the Assistance ID



I tried

var parentID = fd.getSourceID();

var patientID = window.top.GetUrlKeyValue('ID');



if (parentID) {

fd.field('Patient_x0020_Register_x0020_ID').control().value(patientID);

fd.field('Assistance_x0020_Ref_x0020_No_x0').control().value(parentID);

}

with no success

I also swapped

window.top.GetUrlKeyValue('ID'); with window.top.fd.field('Patient_x0020_Register_x0020_ID').value();

with no success


the field name for PatientID is the same in both the Assistance list and the application list (Patient_x0020_Register_x0020_ID)


Is my syntax correct or do I have something else missing? the fd.getsourceid is working fine.


Thanks

Dave Baldwin
Posts: 5
Joined: Fri Mar 03, 2017
Contact:

08 May 2014

forgot to mention that I put that code in the javascript dialog on the New form of the grandchild.

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

12 May 2014

I've answered by email. Please, open the parent form in a main window and place the following code into the grandchild new form to get parent IDs:

Code: Select all

// get assistance log ID:
var assistanceID = fd.getSourceID();

// get patient ID:
var patientID = window.top.GetUrlKeyValue('ID');

Dave Baldwin
Posts: 5
Joined: Fri Mar 03, 2017
Contact:

12 May 2014

This worked perfectly!

Thank you so much.

Dave

craigwat11
Posts: 11
Joined: Thu Apr 24, 2014

19 Jun 2014

Hi, after a bit of help -

I need to add in a button that will basically do the same job as the "New item" link on the related item control. I can add in a button that will open the child form in a dialog but it does not carry accross the Parent ID to the child form. Hopefully that makes sense?

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests