Jump to content

dynamic portal sort with text & number fields


GlennC

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

Recommended Posts

To have a portal sorted in diferent ways I have the sort order of the relationship based on a calc field, which takes its value from a global field. By changing the value in the global field I change the sort order of the portal.

The problem is that I have a mix of text and number fields on which I need to sort. If the calc field is formatted to be a text result, the number fields are sorted as if they are text - for example in ascending order I get 1, 105, 2, etc.

If the calc field is formatted to be a number result, the number fields sort correctly but the text fields don't. Is there a way round this?

Link to comment
Share on other sites

Comment - thanks for the idea, it seems qutie crafty. I'll give it a try.

aaa - In the file that contains the portal data, create a global field (gSort), and a calc field (cSortField). The calculation result should be the field you want to sort on, depending on the value of gSort ie:

case(gSort = "aaa", Field a, gsort = "bbb", Field b etc)

Where you have defined the relationship between the files, select 'sort related records' and make sure cSortfield is selected as the sort field.

Place gSort on the related file display that has the portal, display it as a pop-up menu field,define a value list for this field, using all the possible values that you want for gSort ("aaa", "bbb" etc)

Now by simply selecting the value of gSort from the menu, the portal will automatically sort according to that field.

PS This is for FM6 - you'll need to accomodate differences for FM7, if any.

Link to comment
Share on other sites

This topic is 6993 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.