Heathbo Posted May 25, 2005 Posted May 25, 2005 I have a script on a button that will go to the next record, run a test, with one result will go to one layout, with another result will go to another layout. This works fine and all, but there is a bit of a delay between switching layouts. My question is, is there a way to run a calculation that can determine what the next record is without going to the next record? Maybe based on a calculation field?
aaa Posted May 25, 2005 Posted May 25, 2005 You can build relation by which you can see what contains next record. But if you delete any record, you must to think that relation dont corrupt.
Vaughan Posted May 25, 2005 Posted May 25, 2005 If you are using FMP 7 (and I'm not, so I cannot test this idea) make a self-join on the RecordID serial number, but use the > operator. This (I hope) will relate the current record to all records with bigger serial numbers. The first related record will then be the next record.
Søren Dyhr Posted May 26, 2005 Posted May 26, 2005 If you are using FMP 7 (and I'm not, so I cannot test this idea) make a self-join on the RecordID serial number, but use the > operator. This (I hope) will relate the current record to all records with bigger serial numbers. ...Only it doesn't respect found set and sort order. While jumping to disconnected table occurences does it: http://www.sumware.net/robfm/savingfoundsets.php --sd
comment Posted May 26, 2005 Posted May 26, 2005 And how is a calculation determining the next record supposed to speed up Filemaker going to it?
Søren Dyhr Posted May 26, 2005 Posted May 26, 2005 If the found set and sortorder should be respected, then can't I think of any ...can you?? --sd
comment Posted May 26, 2005 Posted May 26, 2005 No, not really. Heathbo is not telling what the test is. Perhaps, even likely, the problem is there. Even if the test's result could be known beforehand, it would only shift the problem one stage backwards in time (instead of 'go to next record, do the test, select the layout' you would have 'go to next record, select the layout, compute the next next record, do the test').
Heathbo Posted May 26, 2005 Author Posted May 26, 2005 Here are the details. There is a field called card type in one layout but not in the other. The script go to the next record, checks to see if the value in the card type field is greater than 0. If it is, the script will switch to the layout with the card type field. If the value is 0 (as in nothing in the field) then the script switches to layout without the card type field.
aaa Posted May 26, 2005 Posted May 26, 2005 But if you have script, why you dont want do it by script?
Søren Dyhr Posted May 26, 2005 Posted May 26, 2005 Hi Heath Since you're on a Mac could you do it this way ...but I havn't got the faintest idea how to make it x-plat. Examine the upload - but I need to caution you, you have to have the 2 fields shown in the layout ...say in 1 point or such or hidden under a graphical thing?? --sd ChainGang.zip
comment Posted May 26, 2005 Posted May 26, 2005 I have made a simple test and I see no delay. Perhaps your field is an unstored calculation, perhaps your script has some weirdness - frankly, I am tired of guessing.
Søren Dyhr Posted May 26, 2005 Posted May 26, 2005 This is my guess as well, the determination of which layout to go to must be a summaryfield or a selfjoin on a vast number of records??? --sd
Heathbo Posted May 26, 2005 Author Posted May 26, 2005 The original problem was, when the script would run it would go to the next record then change layouts. The problem I kept running into was, you would see one layout before it would switch to the next. Inother words the delay was the script running to determine which layout to go to. So my thoughts were, if the computer knew ahead of time which layout to go to before going to the next record you wouldn't see the wrong layout because there wouldn't be a delay.
-Queue- Posted May 26, 2005 Posted May 26, 2005 It sounds as if adding a simple Freeze Window step at the beginning of script could be useful.
comment Posted May 26, 2005 Posted May 26, 2005 > the delay was the script running to determine which layout to go to I don't think so. More likely, there are some elements on your layout that are computation-heavy, so it takes time to draw the layout before switching to the other one. In any case, Freeze Window should cure this.
Recommended Posts
This topic is 7123 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