How to get value of Child Item in Related Items View
Posted: 03 Dec 2015
When opening up a New form from a Related Items view, I'm using the following code to populate the Child item from the Parent item:
//Populate fields from existing related item (**This Works**)
fd.field('HireDate').value(window.top.fd.field('HireDate').value());
fd.field('BeginningBalance').value(window.top.fd.field('BeginningBalance').value());
fd.field('Points').value(window.top.fd.field('Points').value());
However, populating a Child item from the newly created Parent Item does not work.
Scenario:
1. Edit existing item #1 (works)
2. Create New item #2 in Related View from the Edit Item #1 (works) **fields in item #2 form pre-populate correctly**
3. The newly created item #2 appears in the Related Items view in item #1 (works)
4. Edit newly created item #2 from Related View while still in the original Edit item #1 (works)
5. Create New item #3 in Related View from the Edit Item #2 (there are now two pop up windows open) (works)
6. **Does Not Work** item #3 is populating fields from item #1 instead of item #2 from where it is being created.
Hope that makes sense. Let me know if you have any questions.
Thanks!!!
//Populate fields from existing related item (**This Works**)
fd.field('HireDate').value(window.top.fd.field('HireDate').value());
fd.field('BeginningBalance').value(window.top.fd.field('BeginningBalance').value());
fd.field('Points').value(window.top.fd.field('Points').value());
However, populating a Child item from the newly created Parent Item does not work.
Scenario:
1. Edit existing item #1 (works)
2. Create New item #2 in Related View from the Edit Item #1 (works) **fields in item #2 form pre-populate correctly**
3. The newly created item #2 appears in the Related Items view in item #1 (works)
4. Edit newly created item #2 from Related View while still in the original Edit item #1 (works)
5. Create New item #3 in Related View from the Edit Item #2 (there are now two pop up windows open) (works)
6. **Does Not Work** item #3 is populating fields from item #1 instead of item #2 from where it is being created.
Hope that makes sense. Let me know if you have any questions.
Thanks!!!