how can I add new Item with 2 parentID
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");
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");
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
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.
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.
-
- Posts: 5
- Joined: Fri Mar 03, 2017
- Contact:
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
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
-
- Posts: 5
- Joined: Fri Mar 03, 2017
- Contact:
forgot to mention that I put that code in the javascript dialog on the New form of the grandchild.
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
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');
-
- Posts: 5
- Joined: Fri Mar 03, 2017
- Contact:
This worked perfectly!
Thank you so much.
Dave
Thank you so much.
Dave
-
- Posts: 11
- Joined: Thu Apr 24, 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?
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?
-
- Information
-
Who is online
Users browsing this forum: No registered users and 9 guests