You'll need another script trigger that updates the tab control when the user moves to a different record and if the selected value is to apply to all records, it should be a field with global storage selected so that you get the same value no matter which record is current.
OnRecordLoad with the global field should do the trick.
I thought so... But I don't want the value selection to apply to all records. It's a sponsor database, where most sponsors will be classified as "sole sponsor" while a smaller number will be classified as "primary sponsor" or "secondary sponsor". Some fields are only applicable to one of the latter two profiles, so my goal is to make them hidden in the appropriate invisible tab unless their classification is changed. Then when the user enters an established record, it automatically displays the correct tab, no matter what tab the previously viewed record had visible.
I have three basic Go to Object scripts set up for each of the three tabs, but I'm pretty much lost after that... or maybe there's another way to do it? How would I define the script parameters for the OnRecordLoad?
Thanks for your help!!
I'm assuming that you see one record at a time. Is this the case or do you have a list view of the data set up so that more than one tab control is visible at one time?
You ONRecordLoad script should call the same script you are using to select a tab when you change the field that controls which should be selected.
Yes, viewing only one record at a time. However I don't know how to get the script to work right. If I had a single drop-down or radio button field with three options, how do I get a particular option to navigate to its tab? I imagine it's very straight-forward and I just don't know what I'm doing, so I apologize!! The only thing I've been able to do on my own so far is create a simple Go to Object script triggered by a field modifcation. I split a radio button field into three objects, and had them each call a different Go to Object script for the three tabs. That works, but functionally that seems no different than a visible tab.
Your script can then work like this:
If [table::Tabselector = "Tab one"]
Go To Object ["First Hidden tab"]
Else If [table::Tabselector = "Tab two"]
Go To Object ["Second Hidden tab"]
Go To Object ["Third hidden tab"]
If you name the tabs with object names exactly the same as the values in your value list, it's even simpler:
Go To Object [Table::TabSelector]
This script can be used with OnObjectModify or OnObjectExit to select a tab when a value is selected from the list and can be triggered with OnRecordLoad to select the correct tab when the user navigates to a new record.
Works perfect! I'm sure I would have never gotten it right. Thank you!!!!!!!