GrantSymon Posted November 17, 2005 Posted November 17, 2005 Hi, I can't find out where I'm going wrong here ... I'm sure it's quite simple. I have a self-relationship. I want to be able to change the sort order of a Portal, via scripts. To this end I've made a calc field, based on a global set-field and the sort order is from the calc field. The fields and scripts all work as they should, both when inside and outside the portal. BUT ... the calc doesn't refresh, so the sort isn't effected. Opening and closing the calc field's definition in Define Database, forces it to refresh ... so I *know* the logic is okay, but I can't find any script steps, to make it work. I'm working in FM8 Advanced and don't really want to have to make a separate file just for this. Can anyone tell me how to force refresh a calc? (BTW ... there seems to be too many places to set the sorting prefs for a Portal. In the Portal itself and in the Relationship dialog. What's the difference and why do we have so many options? And ... which one 'wins' if we set the all??) Many thanks for any pointers! Grant
Sanjai Posted November 17, 2005 Posted November 17, 2005 I am not sure if this would be the right solution. In your script where you assign value to the global field, try using the exit record/request script step which updates field data and making no field active.
comment Posted November 17, 2005 Posted November 17, 2005 1. Wrap your script with these two steps: Freeze Window <> Refresh Window [ Flush cached join results ] 2. Portal sort order overrides the relationship's sort order. Portal sort order is local - it affects only the specific portal on the specific layout. A relationship's sort order is general - for example, if a calculation relies on an ordered relationship, it will be evaluated using the relationship's sort order.
GrantSymon Posted November 17, 2005 Author Posted November 17, 2005 Hi Sanjai, thanks for the reply. That script step doesn't exist in FM8 (not in my copy anyway ), but I've tried the 'Commit Record' step and it doesn't work. I've tried pretty much all the obvious script steps ... even 'flush cache'. Seems there must be some way of doing this, other than having the whole thing in an external file? Grant
GrantSymon Posted November 17, 2005 Author Posted November 17, 2005 Excellent!! Thanks ... errr... Mr Comment I spent a lot of time this afternoon, fiddling around with various permutations, tried both of those steps, but not together. Still ... I learned some other stuff. Which brings me neatly to ... thanks for the explanation of the sorting prefs. So much to learn, so little time. (I remember when it used to be ... so many girls to kiss, so little time. Ho hum. ) Grant
Recommended Posts
This topic is 6946 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