Questions posted in Alpha Five forum: link
The answer is correct for the ID, but it doesn't answer the more general case.
Where exactly does the parent ID get entered into the child grid?
Can someone answer this question for filling in the field in the detail from something in the grid other than the ID of the parent?
I have a nesting of grids for tables of Project -> Group -> Item and on entering a new Item record with detail view in Item, I'd like to get the ID not just of the selected Group to fill in a field of Item (which works), but also put selected Project ID in a field in the new Item.
Thanks much!
Posted second version in: link
1) Where exactly does the parent ID get entered into the detail view when adding a new record to a grid?
2) How can I get the IDs for several grids nested above the detail view for a "New Record" being added, and put them in fields of the new record?
Details:
I have a nesting of grids (using Row Expanders) for tables of Project -> Group -> Item and on entering a new Item record with detail view in Item, I'd like to get the ID not just of the selected Group to fill in a field of Item (which works), but also put the selected Project ID (detailview -> parent_groupgrid -> parent_project.ID) in a field in the new Item.
I think I want to add something to Item Grid -> properties -> Javascript System Events, but not sure whether I should use canDetailViewNewRecord or something else, and what javascript should I use.
Thanks much!
Possibly related:
- Searches:
- "detail view" "initial value" parent grid
- "detail view" parent
- Unanswered from 6/30/2011: grid.object parent and child reference - http://msgboard.alphasoftware.com/alphaforum/showthread.php?87614-actionscript-grid.object-parent-and-child-reference&highlight=detail+view+parent
- Unanswered from 6/13/2011: passing a parent grid variable to an xbasic function - http://msgboard.alphasoftware.com/alphaforum/showthread.php?94259-Passing-a-parent-grid-Variable-to-an-xbasic-function.&highlight=Detail+view+parent+field
- unanswered from 8/27/2010: http://msgboard.alphasoftware.com/alphaforum/showthread.php?88933-Initial-value&highlight=detail+view+initial+value+parent+grid
- answered only for passing ID from grid to detail, not more general question of other fields (see above post to the thread): http://msgboard.alphasoftware.com/alphaforum/showthread.php?87885-Set-the-Value-of-a-Field-on-the-Detail-view-from-the-Grid-data&highlight=detail+view+initial+value+parent+grid
- Similar question, with some ideas, but no actual javascript code: http://msgboard.alphasoftware.com/alphaforum/showthread.php?85419-Question-regarding-adding-new-records&highlight=detail+view+initial+value+parent+grid
- Unanswered: How to pass field values from a parent to a child grid - http://msgboard.alphasoftware.com/alphaforum/showthread.php?66663-passing-field-values-from-a-parent-to-a-child-grid&highlight=detail+view+initial+value+parent+grid
- running grid without parent, how to avoid getting error if session variable not present - http://msgboard.alphasoftware.com/alphaforum/showthread.php?92748-session-variable-trap&highlight=detail+view+initial+value+parent+grid
- Used OnInitialValueCalculate event
- Suggested:
if eval_valid("session.variable_name") then 'Do your code end if
- Possible answer:
- Row Expander - http://msgboard.alphasoftware.com/alphaforum/showthread.php?89739-Row-Expander&highlight=detail+view+initial+value+parent+grid
- Put this code in afterDetailViewOpen and/or afterDetailViewNewRecord events:
var p_obj = {Grid.object}.getParentObject(); if(p_obj){ var p_row = p_obj._selectedRow; var p_name = p_obj._getValue('G','NAME',p_row); alert(p_name); };
What I tried...
Tried this for initial value for a nested project_id field, but it wouldn't allow new record to get added from live preview:
={Grid.object}.getParentObject()._selectedRow._getValue('G','PROJECT_ID',{Grid.object}.getParentObject()._selectedRow)
Other interesting links:
- Sending information from table to table - http://msgboard.alphasoftware.com/alphaforum/showthread.php?93920-Sending-Information-Form-Table-To-Table&highlight=linking
- Multi-user multi-company one-server-web application - http://msgboard.alphasoftware.com/alphaforum/showthread.php?92599-Multi-user-multi-company-one-server-web-application&highlight=linking
- Want to save a value in a field on the child table - http://msgboard.alphasoftware.com/alphaforum/showthread.php?94541-Completely-stumped-help-please&highlight=Detail+view+parent+field
- Get logged in user name and populate field - http://msgboard.alphasoftware.com/alphaforum/showthread.php?94335-get-logged-in-user-name-and-populate-field&highlight=Detail+view+parent+field
- Question regarding adding new records - http://msgboard.alphasoftware.com/alphaforum/showthread.php?85419-Question-regarding-adding-new-records&highlight=detail+view+parent
- Set the value of a field on the detail view from the grid data - http://msgboard.alphasoftware.com/alphaforum/showthread.php?87885-Set-the-Value-of-a-Field-on-the-Detail-view-from-the-Grid-data&highlight=detail+view+parent
- Update linked grid, how to update parent - http://msgboard.alphasoftware.com/alphaforum/showthread.php?91646-updated-linked-grid-how-to-update-parent&highlight=detail+view
- Tabbed UI - master & detail tabs - http://msgboard.alphasoftware.com/alphaforum/showthread.php?93412-TabbedUI-Master-amp-Detail-Tabs&highlight=detail+view
- Make session variables contain a field that exists in detail view - http://msgboard.alphasoftware.com/alphaforum/showthread.php?89843-session-variables&highlight=detail+view
- Issue with session timeout - http://msgboard.alphasoftware.com/alphaforum/showthread.php?70590-Session-Timeout
- Videos for Alpha 10 Preview - http://news.alphasoftware.com/v10preview/videos.htm
- Getting started videos - http://www.alphasoftware.com/gettingStarted/
- Alpha 10 readme first - http://wiki.alphasoftware.com/Read%20me%20first%20V10
- Software comparision grid - http://blog.alphasoftware.com/search/label/Comparison%20grid
- Don't get lost in the clouds - http://www.businesswire.com/news/home/20110412006385/en/Don%E2%80%99t-Lost-Clouds-Protect-Database-Investment-Alpha
- Problem with quickbase, caspio, zoho - http://blog.alphasoftware.com/2011/04/problem-with-quickbase-caspio-zoho-and.html
- Ajax video tutorials - http://www.ajaxvideotutorials.com/V10Videos/HowToPassJavascriptVariablesFromOneGridToAnother.swf
- How to debug image file reference fields - http://wiki.alphasoftware.com/How+to+Debug+Image+File+Reference+Fields
- Placing image file reference fields - http://wiki.alphasoftware.com/Placing+Image+File+Reference+Fields
- Image file reference field hyperlink - http://msgboard.alphasoftware.com/alphaforum/showthread.php?93493-Image-File-Reference-Field-Hyperlink
- Grid component how to topics - http://wiki.alphasoftware.com/Grid+Component+How+To+Topics+V10&structure=What%27s+New+in+Version+10