hamelekim Posted December 6, 2005 Posted December 6, 2005 I have two portals with the same table for both. In one I have a one line list of three fields. The second portal is all the information from the table. I want to be able to click on a row in the first portal and have the second portal go to the same record to display all the information for that specific row. Is there a way to put the focus on another portal when you are in one already and to select a portal row based on a primary key? I was reading on another forum that this was possible but the person didn't explain how to do it. Thanks.
mr_vodka Posted December 6, 2005 Posted December 6, 2005 Lets say in your first portal you have 10 records with a field called LastName. In your second portal you should have the sme 10 records but showing lets say the fields FirstName and Age. You can put a button on the first portal's field or row and then use a script like this. Set Variable [$numRow; Get ( PortalRowNumber )] Go to Field [Contacts::FirstName] Go to Portal Row [select; No Dialog; $numRow] Make sure if you use this method, that that field that you select for the 'Go to Field' step is not used in both portals otherwise it might default to the first portal.
comment Posted December 6, 2005 Posted December 6, 2005 If I correctly understand the purpose here, a better method would be to have a button in the first portal that sets a global field to the related child's ID. Then create a new TO of the child table and define the relationship to the parent table: Parent::gChildID = CurrentChild::ChildID Finally, place related fields from the CurrentChild TO directly on the parent layout.
hamelekim Posted December 6, 2005 Author Posted December 6, 2005 Ah, oops, my mistake. I guess they are two different tables. One has an item number, and then the second portal is all the information from another table for that item number. I tried what you said, and although it selected the second table it didn't actually go to the proper row in the second one. I will have to fool around with it a bit more. I don't think that have different tables makes a difference with the script correct?
hamelekim Posted December 6, 2005 Author Posted December 6, 2005 If I correctly understand the purpose here, a better method would be to have a button in the first portal that sets a global field to the related child's ID. Then create a new TO of the child table and define the relationship to the parent table: Parent::gChildID = CurrentChild::ChildID Finally, place related fields from the CurrentChild TO directly on the parent layout. Yeah. I would rather not have the fields in another portal, just have them underneath the first portal and then when I click on a portal row the information for that row id will show up in the fields below from the other table. I didn't think I could do it that way though. Also what do you mean my TO? Never heard of that abreviation before. Thanks.
comment Posted December 6, 2005 Posted December 6, 2005 TO = Table Occurence I suggest you post your file, or a mock-up with the three(?) tables involved.
mr_vodka Posted December 6, 2005 Posted December 6, 2005 The solution I offered was only if they were from the same table as you originally posted. If they are from different tables then yes you must have a button on the first portal set a global field that will be related to the child table. If you do not want to use a second portal but want to have the information fields on the layout itself then just put those related fields on the layout beneath the selection portal.
hamelekim Posted December 6, 2005 Author Posted December 6, 2005 Actually that script worked exactly the way I wanted it to without the tables in each portal being the same. I click on a portal row and it goes to the same row in the other table. I just made a script that checks to see if the value has been created in the other table yet and if not it goes and creates it and then goes to that row.
Recommended Posts
This topic is 6927 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now