I have a To Do list that's a browse screen. Right now when the user selects a record, they are taken to the Organization edit screen. What I want the system to do is open the second tab on the Organization screen and go to the record in the subform on that tab that matches the record clicked on in the To Do list.
I see the start to the solution is to use the nuSelectBrowse(e) function in the To Do list to open the Organization edit form, but I don't know how to open the second tab or go to the needed record in the subform. Suggestions?
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Open to specific record in subform
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Open to specific record in subform
To open a specific tab when the user selects a record in a Browse Screen, declare a function nuSelectBrowse() and set a window variable (e.g. openTab) with the title of the tab to open.
When the edit form is opened, retrieve the tab title and select that tab.
Code: Select all
function nuSelectBrowse(e){
window.openTab = 'TabX'; // <---- Title of the tab to be opened.
const recordId = $('#' + e.target.id).attr('data-nu-primary-key');
nuForm(nuGetProperty('form_id'), recordId, '', '', '2');
}
When the edit form is opened, retrieve the tab title and select that tab.
Code: Select all
if (window.openTab) {
nuSelectTabByTitle(window.openTab);
window.openTab = undefined;
}
How to identify that record?and go to the record in the subform on that tab that matches the record clicked on in the To Do lis
You do not have the required permissions to view the files attached to this post.
Re: Open to specific record in subform
The browse record clicked on will have the primary key available.
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Open to specific record in subform
The record in the subform has the same PK as the record clicked on in the ToDo list browse window.
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Open to specific record in subform
I think I answered your question already 2 years ago: viewtopic.php?p=25275#p25275