Jump to content

Sorting in a portal


Stick

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

Recommended Posts

I have a portal containing fields from self-join (for IWP purposes).

To sort a portal am I right in thinking that you can only do this from the relationship builder - in which case you can only sort the portal by fields contained in that portal? Or is there some to other way i can sort it?

thanks

Emma

Link to comment
Share on other sites

Hi Emma,

If you double-click your portal (or right-click > Portal Format) you can sort your portal on ANY field listed in that table. It doesn't have to be a field contained in the portal. Unless I'm missing your point somehow, that should work fine for you. Let us know if you needed something else. smile.gif

Oh. IWP? I'm unsure if this makes a difference, sorry. Maybe others know.

LaRetta

Link to comment
Share on other sites

blush.gif humm oh yeah, feeling a little silly now - I had completely forgotten about that option.

However, I would need the user to change what the portal is sorted by, i.e. initially set to sort by supplier, they would want to change this to sort by section.

So is there a script step/steps that could do this?

Thanks

Emma

Link to comment
Share on other sites

An easy, inelegant way to do this is to create multiple layouts, identical in every way except with differently sorted portals. This could be a maintenance headache....

Another way is to sort on a calculation field that conditionally outputs different results based on user input.

case (

global=value1,field1

global=value2,field2

etc.

)

by using a script to toggle values in the global field, you can toggle the values in the sorted calc field.

One caveat is that if you want to sort on date/time values they won't sort properly since you have to output all values as one type (text,number, date, or time) so you have to play tricks like padding the time and date results with 0's to get them to sort properly. Also, you can only sort in one direction (you can't reverse sort order dynamically)

There is a great example of dynamic portal dislplay on www.filemakermagazine.com

Dana

Link to comment
Share on other sites

Thanks for your suggestion, I would do it the inelegant way as they would only need to order in 2 different ways.

However, I have realised that the field I want to order by is actually a related field - therefore does not appear when you double click the portal and try and sort it from there.

Is there a way of sorting by a field that is related?

Link to comment
Share on other sites

Yep!

Create a calculation field in the table the portal is based on, and simply have it calculate the result of the related field.

So if the portal table is X, the related table is Y, and you want to sort by field Z, the calculation would look something like:

Y::Z

Then sort by the calculation field -- oh, and I recommend not storing the calculation results, as I suspect it might throw things off when you make changes to the related table. The sort might take longer that way, but it should still continue to work correctly, and correctness is more important than speed.

Link to comment
Share on other sites

This seems to be the same issue that's being discussed in thread "Portal sorting refresh problem".

FDE, I'm not quite following what you mean by Y::Z as a calculation.

Anyway, isn't this also going to result in an unindexable field that won't sort properly? (See other thread.)

Love to hear more about a workable solution.

Link to comment
Share on other sites

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