Richard Scales Posted November 9, 2009 Posted November 9, 2009 Working for years in Filemaker up to V5.5 I have now jumped to V10 and am failing at my first hurdle. In am combining everything into a single file using tables where I would used to have used several different files. I have a file with a table called 'clients' and a table called 'Policies'. There are three different layouts to display different policy types depending on a field value. Policies for each client are displayed in a Portal view, a button on each row runs a script. I am using the GotoRelatedRecord step to show the record from the policies table and selecting the layout from a calculation based on the contents of the policy type field. I have used case as well as if statements and it fails 100% of the time. I have assumed that if I try to select layouts from a calc with a text answer, the answer must match the layout name. I have also tried using layout numbers. In either case the selected layout is always the same one. Have I missed something fundamental or should I be able to achieve it using this simple single script step? If I use the GTRR step and then follow it with either a case or nested if to then re-select the desired layout - it appears to work OK though I am about to embark on more testing to be sure. Any pointers regarding the use of GTRR in what I perceive to be a most basic form would be very helpful and much appreciated.
Vaughan Posted November 9, 2009 Posted November 9, 2009 If I use the GTRR step and then follow it with either a case or nested if to then re-select the desired layout - it appears to work OK That's the way I've always done it and it works well. I have a "base" layout for each table which I never delete. These are used as the targets for the GTRR steps (amongst other things) after which I change to the desired layout. That way I can delete a print layout, say, and not have to worry that I've just silently broken a GTRR script step somewhere.
Richard Scales Posted November 10, 2009 Author Posted November 10, 2009 Thank you for that - from what I can see - in Filemaker 10 at least - the GTRR step has all the features that should allow the selection of a layout - it just didn't work! - I shall stick to you method which does indeed work. Thanks again.
Vaughan Posted November 10, 2009 Posted November 10, 2009 If you use the layout name in the calculation, then the name has to be literally typed. Typical reasons for failure include leading and trailing spaces in the layout name. Because the name needs to be hard-coded into the calculation, any re-naming of the layout will cause it to break. Post the calculation you were using so we can see it.
Richard Scales Posted November 10, 2009 Author Posted November 10, 2009 Here is the calc. The table from which the script is being called is 'clients', the table which is used for the layouts being selected is called 'Policies'. The field which describes the policy type is 'Policies::Pol_Type' which is a numeric field and its contents are 0,1 or 2 (only testing with 0 and 1 at the moment). The Layouts are named as per the names in the calc field - same case and spaces etc. Case ( Policies::Pol_type=0; "Assurance Policies"; Policies::Pol_type=1; "Pension Policies" )
LaRetta Posted November 10, 2009 Posted November 10, 2009 YOu realize that, being in Clients when you fire the GTRR, the calculation evaluates from there as well. And the calculation looks to related Policies table to decide which layout, right? Can a client have more than one policy? If you have more than one related Policy, FM will only see the first related record (thus always jumping there). Just speculation ...
Richard Scales Posted November 10, 2009 Author Posted November 10, 2009 I can see that is exactly what is happening. Thus I can see why the 'fix' that I am using to subsequently select the required layout following the GTRR is working for me. Thank you for explaining that.
Recommended Posts
This topic is 5493 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