February 24, 200520 yr 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?
February 24, 200520 yr 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.
February 24, 200520 yr 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.
February 25, 200520 yr Author 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.
February 25, 200520 yr 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.
Create an account or sign in to comment