tomp Posted March 7, 2005 Posted March 7, 2005 I find it interesting that in FM7 you can define a sort sequence when defining a relationship and then define another when use the relationship in a portal. I would like to take advantage of that latter feature and change the sort sequence in a portal somehow within a script. Otherwise I believe I would need to have a different layout for each sequence I would like to display the data in. I want the user to be able to toggle through different sequencing options of the portal with the click of a button. Is there a way to change the sort sequence of a portal from within a script (without user interaction other than the 'toggle' button)? TIA Tomp
Han Posted March 8, 2005 Posted March 8, 2005 Hallo Tomp, That is my problem also, i have created 2 buttons, first button for sort order by first field and second button for sort order by second field, so what script can do that without create other layout ? Can all help me ?
Han Posted March 8, 2005 Posted March 8, 2005 Hallo Tomp, That is my problem also, i have created 2 buttons, first button for sort order by first field and second button for sort order by second field, so what script can do that without create other layout ? Can all help me ?
Han Posted March 8, 2005 Posted March 8, 2005 Hallo Tomp, That is my problem also, i have created 2 buttons, first button for sort order by first field and second button for sort order by second field, so what script can do that without create other layout ? Can all help me ?
dkemme Posted March 8, 2005 Posted March 8, 2005 The easiest way is to create two layouts. If this is not an option you could create another field that is a calculation that you could perform the sort with. Have the calculation depend upon a value in a global that a script can change, triggering a different sort schema.
dkemme Posted March 8, 2005 Posted March 8, 2005 The easiest way is to create two layouts. If this is not an option you could create another field that is a calculation that you could perform the sort with. Have the calculation depend upon a value in a global that a script can change, triggering a different sort schema.
dkemme Posted March 8, 2005 Posted March 8, 2005 The easiest way is to create two layouts. If this is not an option you could create another field that is a calculation that you could perform the sort with. Have the calculation depend upon a value in a global that a script can change, triggering a different sort schema.
Han Posted March 12, 2005 Posted March 12, 2005 Thank you dkemme, I have tried to create global field for saving sort option values and calculation field for select value to sort, but sorting still can't switch, if i display calculation fields values is true, why that can't switch ?
Han Posted March 12, 2005 Posted March 12, 2005 Thank you dkemme, I have tried to create global field for saving sort option values and calculation field for select value to sort, but sorting still can't switch, if i display calculation fields values is true, why that can't switch ?
Han Posted March 12, 2005 Posted March 12, 2005 Thank you dkemme, I have tried to create global field for saving sort option values and calculation field for select value to sort, but sorting still can't switch, if i display calculation fields values is true, why that can't switch ?
bikergeek Posted March 12, 2005 Posted March 12, 2005 You have to change the value of one of the portal records for the sort to be updated in the portal. You can do this by script, such as: Set Field [portalField ; portalField & " "] Set Field [portalField ; Trim ( portalField )] Commit Records [no dialog] It won't work automatically without the commit step.
bikergeek Posted March 12, 2005 Posted March 12, 2005 You have to change the value of one of the portal records for the sort to be updated in the portal. You can do this by script, such as: Set Field [portalField ; portalField & " "] Set Field [portalField ; Trim ( portalField )] Commit Records [no dialog] It won't work automatically without the commit step.
bikergeek Posted March 12, 2005 Posted March 12, 2005 You have to change the value of one of the portal records for the sort to be updated in the portal. You can do this by script, such as: Set Field [portalField ; portalField & " "] Set Field [portalField ; Trim ( portalField )] Commit Records [no dialog] It won't work automatically without the commit step.
stevie.at Posted April 7, 2005 Posted April 7, 2005 I use a global field to trigger the sort criteria what works fine (all in 1 layout with buttons). I use the Refresh Window Script step (and flush cashed join results) to commit the records' sort order. But in my case there's another problem coming up: I'd like to sort either by date or by name, but as my global sortFiled itself has to be of a certain type (in my case text) it's not sorting correct if you choose to sort by date, because it's treated like a text field... Is there any way to change the field type of one field dynamically (means if you want to sort by name...field type is a text-field, otherwise by date it's a date-field) to make this work?
stevie.at Posted April 7, 2005 Posted April 7, 2005 I just figured out was I was asking...if anyone else got the same problem: Use the GetAsNumber function to transform the date into the right format...should work!
Ugo DI LUCA Posted April 7, 2005 Posted April 7, 2005 Hi, The Date & "" The Hour & "" works equally. You may want to check EasyPortalSortUS.fp7 as it has a calculation which allows to sort whatever type of fields you'd be dealing with would it be text, hour, date or numbers, and whatever sort you decided. HTH
JerrySalem Posted July 8, 2005 Posted July 8, 2005 Ugo I just tried your EasyPortalsort. It looks fabulous! However, dosn't work for me in my solution. I got the buttons to work, so that the gParameter changes values 1, -1, 2, -2 etc. I also got the SortKey to change values based on the buttons. But try as I might, the portal won't resort! Any suggestions? Jerry
Ugo DI LUCA Posted July 10, 2005 Posted July 10, 2005 The example is based on a self join. In the case of a classic portal, you might consider using a Refresh Window script step with flush cache etc. If you still have issue with it, contact me directly to see what your settings are compared to the example file. HTH
n1k0 Posted July 26, 2005 Posted July 26, 2005 Anyone know what hoops I have to jump through in FMP 6v4 to get a portal that is sorted on a calculation (using getfield) to refresh? If I allow entry into the portal fields, I can get it to refresh with a simple "go to portal row (last)" script step followed by "go to record/request (select)" with no record. But the moment I block entry into the portal fields, it goes buggy! Any clever hacks out there?
n1k0 Posted July 26, 2005 Posted July 26, 2005 got it to work with a simple enter preview mode[] enter browse mode[]
Vaughan Posted July 26, 2005 Posted July 26, 2005 Sometimes, but not always, you can avoid the Preveiw/Browse switch trick by instead refreshing the screen with a Freeze Window step.
Recommended Posts
This topic is 7061 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