Related item: prepopulate second field, not ID
I hame a related item on Edit form done with these instructions:
http://spform.com/office-365/crea ... office-365
And My ID is populating correctly without any issues. But i have another look up field from parent which i need to populate on new related item. How i can do that? I tryed fd.populateFields - no luck...
http://spform.com/office-365/crea ... office-365
And My ID is populating correctly without any issues. But i have another look up field from parent which i need to populate on new related item. How i can do that? I tryed fd.populateFields - no luck...
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi Katy,
If you're adding child items via a dialog, you can get parent's field values this way:
window.top.fd.field('FieldName').value()
If you're adding child items via a dialog, you can get parent's field values this way:
window.top.fd.field('FieldName').value()
May be i am not doing it right but this is not working. So let me explain once again:
I have two lists: main wit WeekID and EmployeeType field and child which is connected to main by WeekID and the Type field is an added column (it is shown in the list like WeekID:EmployeeType) . Yes, i am adding new items via dialogue so on new item child list form i have the following code:
var parentID = fd.getSourceID();
if (parentID) {
fd.field('WeekID').control().value(parentID);
window.top.fd.field('WeekID_x003a_EmployeeType').value();
$('.WeekID').hide();
}
WeekID - no problem with getting it, but WeekID:EmployeeType is just staying blank.
I have two lists: main wit WeekID and EmployeeType field and child which is connected to main by WeekID and the Type field is an added column (it is shown in the list like WeekID:EmployeeType) . Yes, i am adding new items via dialogue so on new item child list form i have the following code:
var parentID = fd.getSourceID();
if (parentID) {
fd.field('WeekID').control().value(parentID);
window.top.fd.field('WeekID_x003a_EmployeeType').value();
$('.WeekID').hide();
}
WeekID - no problem with getting it, but WeekID:EmployeeType is just staying blank.
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi Katy,
Try to output the Type:
alert(window.top.fd.field('WeekID_x003a_EmployeeType').value());
what's the result. Is the Type field located and displayed in the parent form?
Try to output the Type:
alert(window.top.fd.field('WeekID_x003a_EmployeeType').value());
what's the result. Is the Type field located and displayed in the parent form?
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
Please, try to output the following:
alert(window.top.fd.field('WeekID_x003a_EmployeeType').control()._el().text());
Please, try to output the following:
alert(window.top.fd.field('WeekID_x003a_EmployeeType').control()._el().text());
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Are you sure that the field is not empty on the parent form? Could you provide HTML-source of the form? Drop it to support@spform.com.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 7 guests