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

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

Recommended Posts

Posted

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

Posted

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 ?

Posted

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 ?

Posted

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 ?

Posted

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.

Posted

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.

Posted

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.

Posted

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 ?

Posted

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 ?

Posted

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 ?

Posted

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.

Posted

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.

Posted

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.

  • 4 weeks later...
Posted

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?

Posted

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!

Posted

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

  • 3 months later...
Posted

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

Posted

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

  • 3 weeks later...
Posted

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?

Posted

Sometimes, but not always, you can avoid the Preveiw/Browse switch trick by instead refreshing the screen with a Freeze Window step.

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 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.