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

dynamic portal sort with text & number fields


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

Recommended Posts

Posted

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?

Posted

Try to use GetField() function, may be this function will help you. And i want to know how you sort portal using global field. I will be thankful to you.

Posted

You might want to try something like:

Right ( "000" & numberField ) ; 3 )

You'll have the adjust the number of the paddings zeros and the length of the returned string to the max. possible value in your case. That makes it kind of clunky, but it can work.

Posted

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.

Posted

Thank you very mach. It is good idea. I rember ar last time i did it with Getfield() function. One question yet: tell me this work quickly?

Thanks advance.

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