digit Posted April 17, 2009 Posted April 17, 2009 (edited) Hi I would be grateful if you could help me out here. I guess this must be simple but I cannot get around it! How could I create a script to go a record according to the value in a field? I would like to be able to move through different layouts, based on value c or value z. So if in field 'type' the value is 'z' I would like to go to layout 2. Otherwise to go to layout 3. Many thanks! Edited April 17, 2009 by Guest
bcooney Posted April 17, 2009 Posted April 17, 2009 Check out the Go to Related Records script step. Also, take apart some of the sample files that come with FM to see how to build relationships.
digit Posted April 17, 2009 Author Posted April 17, 2009 Thanks for your reply. I know how to build relationships, my problem is that I want to make a calculation for a script that will choose the correct layout based on a value I have given (with another script) in another field. I have a table with 47 fields, for two different types of objects. I would like to be able to find records from only one type of objects automatically that in field 'x' have the value 'c'.
mr_vodka Posted April 17, 2009 Posted April 17, 2009 Could you please use real names instead of abstract examples?
Fitch Posted April 17, 2009 Posted April 17, 2009 The most straightforward way is a script like this: If( type = "z") Go to layout(2) Else Go to layout(3) End If If you're using FM8 as indicated in your profile, you'll have to click a button or select the script from the scripts menu to run the script, or use a plugin such as zippScript if you want to automatically change layouts. In FM10 you can make field data changes trigger scripts without a plugin.
Lee Smith Posted April 17, 2009 Posted April 17, 2009 Hi Tom, ...Snip... use a plugin such as zippScript ... snip zippScript is no longer available. Lee
Fitch Posted April 17, 2009 Posted April 17, 2009 True. I guess DoScript would be the best free option now.
Recommended Posts
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