Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Sorting Portals with Calc field


This topic is 6946 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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.

Posted

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.

Posted

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

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.