May 24, 201213 yr I have created a two tab control: 'Job' and 'History of Work' on a layout displaying the customer. The 'History of Work' uses a portal to display list of jobs done, whereas the 'Job' displays fields from a record in the job table. At present the 'Job' displays the last job entered which is ok but I would also like to select a job in the portal and have the 'Job' tab become active and display the selected job information. I can't seam to work out the last bit on displaying the selected job info.
May 24, 201213 yr You'll need to give the Job tab an object name (via the Inspector palette), so you can use the Go to Object script step. You'll need a global field to store the selected job ID, and a relationship from this field to the Job table. You can keep your existing Job table occurrence (TO) in the relationship graph, but you'll make a new TO for this. The fields on the Job tab will be from the new TO. Your script will be called from a button in your History portal, something like: Set Field( global Job ID; related::job id) Go to Object( "job tab" ) There's another slightly tricky part: what happens when you go to a different customer? You don't want to show job info from the previous record. I would suggest you set a layout script trigger to use the same script or a variation of it to control the global Job ID field.
May 25, 201213 yr Author Thanks Fitch, I can't understand why I need to use a TO and global fields, I created a script that runs when a portal line is selected, it copies the job ID of the line clicked to a veriable, it then makes the 'Job' tab active, I was trying to use the variable (jod_ID) to display the correct record. I take it that this method I was trying won't work.
May 25, 201213 yr See if this helps: http://fmforums.com/forum/topic/71867-getting-more-out-of-filtered-portals-2view-selected-child/
May 25, 201213 yr Author Thanks comment, can't see how thats helped me, sorry Ive tried to work out what is happening but perhaps I'm missing something
May 25, 201213 yr I can't understand why I need to use a TO and global fields, I created a script that runs when a portal line is selected, it copies the job ID of the line clicked to a veriable, it then makes the 'Job' tab active, I was trying to use the variable (jod_ID) to display the correct record. That's exactly what my file does (minus the tab control, which I understand you have working).
May 26, 201213 yr Author That's exactly what my file does (minus the tab control, which I understand you have working). Thats correct, but after the tab 'Job' is active, its not displaying the job information that was selected in the 'History of Work' tab, it still showing the last job entered. I'm not sure of the script to do this. The script I have written stores the correctly selected jobID in a variable when a job is selected in the 'History of Work' tab and then activates the 'Job' tab, that all works but I dont know how to pass that variable on to get it to update the 'Job' tab info. I thought I was nearly there with the script I had created, until Fitch kindly suggested using a global field and table occurrence, I dont mind working through that method if that is the only way, it just seemed a lot of work. I have a little understanding of scripting and FM, Im still trying to get my head around it properly.
May 26, 201213 yr I thought I was nearly there with the script I had created, until Fitch kindly suggested using a global field and table occurrence, I dont mind working through that method if that is the only way, it just seemed a lot of work. It's one way, not the only way. The other option is to use a filtered portal, as shown in my demo. If you place the filtered portal inside the Job tab, you'll be done.
May 26, 201213 yr Author Well I must be missing something because the file I downloaded, 'ViewSelectedChild11', as I click in the different 'childs', they change blue to show their selected but the 'details' stay set for the first 'child' in the list. I assume the details for each 'child' should change.
May 26, 201213 yr I assume the details for each 'child' should change. They most definitely should. I haven't installed v.12 yet - perhaps there's some issue with the conversion?
May 26, 201213 yr Author Ahrrrrr, thats what it is then, Its because I'm using v.12. I also have v.9 but the same problem. Whats so different between v.11 and v.12, or is it the conversation thats doing it.
May 26, 201213 yr I don't know. I see no reason why it wouldn't work in v.12 and I wouldn't want to jump to any conclusions.
May 27, 201213 yr Author No problem comment, I worked through Fitch's option last night and have managed to get it to work. Wasn't that difficult in the end. Learnt a lot about TO's and why they are used, so very pleased about that. Thanks guy's for you help, much appreciated.
May 29, 201213 yr Glad you got it working. I like the filtered portal method though, and I would probably go that route in version 11 or higher. (You mentioned version 9 -- filtered portals were introduced in 11.) Michael's sample file converted to 12 with no issues for me.
May 29, 201213 yr Author Michael's sample file converted to 12 with no issues for me. Just downloaded it again and tried it in v.12 and it all works, so not sure what happened the first time. Thanks again guy's
Create an account or sign in to comment