Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Is there a way for a custom sort?


Wingwalker

Recommended Posts

As you know with the current "Sort Records" command. It allows a full sort of the fields in the file your in and any other related file as well. Is there a way to set up a custom sort menu? One where you can click on a sort button and it will bring up a popup list allowing you to select a sort from the pre-defined list. I know there are ways to click on a header label like "Name" but I would rather have a popup list if there was a good way to do it.

 

Thanks for your help

Link to comment
Share on other sites

You can make a script:

 

if["PopupValue=fieldA]

sort[restore, no dialog] #by fieldA

else if["PopupValue=fieldB]

sort[restore, no dialog] #by fieldB

else if

#etcetera

end if

 

kjoe

Link to comment
Share on other sites

Hi Kjoe,

 

Thanks for your reply. I think I understand the script except, where do I get the "PopupValu"? I'm sure it's a dumb question but your help would be appreciated.

 

Thanks

Link to comment
Share on other sites

Using GetField() you can dynamically choose sort fields. You may have to do some workarounds to make Date, Time, and Number fields sort correctly, as the result of the GetField() calcs will be text.

 

The attached demo shows a GetField() method for dynamically choosing fields for a portal, for a report, and for sorting the report.

Link to comment
Share on other sites

Perform each desired sort manually, then create a sort script saving each sort just performed. Then create a button which chooses a sort script based upon the value list choice.

 

Be well . . .

 

Tom smile.gif

Link to comment
Share on other sites

Hello there Wings-of-Man,

 

Sort by Popup list "Boo-Hiss". You've been out on that wing far too long my friend. But you have a choice... I first thought maybe it’s a matter of real estate, but you have to label the fields right? And your not using a portal right! Well, I guess you could have the name of the field show within the field, but I doubt you’re doing that. So forget that Popup deal. It’s quirky at best, inefficient at worst!

 

You've established you want to use pre-determined sorts, so here’s one that is quick, easy and requires no overhead.

 

If [Get (Sort State ) ]

Unsort Records

Else

If [Get (ScriptParameter ) = 1]

Sort Records [ Restore; No dialog]

End if

If [Get (ScriptParameter ) = 2]

Sort Records [ Restore; No dialog]

End if

End if

Go to Record/Request/Page [First]

 

Just string as many ScriptParameter’s as needed in combination with the sorts and you’re good to go Pilgrim.

 

I’d buy FMP 7 for the new sort characteristics alone!

 

It’s simple, it’s easy to explain to the user, “hey, if you want to sort a field click on the label above the field!” And it does not require extra buttons and realistate. Keep it simple, this ain’t rocket science. You don’t want to be er, left out on the Wing.......Walker.....

 

Sometimes you have to be careful of the question you ask and the answers you get. I was in line to vote in the Presidential election. I asked a poll worker about how to mark the ballot. You know, because of the hanging chads and all the stuff we had here in Florida and she replied, “the information was clearly marked on the wall of the voting booth.” When I stepped into the booth what I saw on the wall said, “fold top down, cross legs, collapse.” Don’t you just hate when that happens…

 

Harry

Link to comment
Share on other sites

First I want to thank everyone for your help. I've learned a lot going through this process. Ender, your download was invaluable.

 

I ended up doing what I didn’t think I wanted and that was Harry’s suggestion of setting up the labels as sorting click buttons. One of the things that got me away from this were some of the samples I saw and the scripting and maneuvering needed to make it work. It just didn’t look like something I could do. But the script Harry posted was simple enough that even I could do it and it’s working great. I thought I would like to add Ascending and descending to the script, but I realized that is really no longer a big deal because I can handle that directly in my sort parameters for those fields where descending would be helpful.

 

Thanks everybody, as I said earlier, I learned a lot. And I "don’t want to be er, left out on the Wing.......Walker.....

Link to comment
Share on other sites

Hello again Wingis-of-walkis!

 

The Beach Boys said it best, "She had fun fun fun till her daddy took her T-Bird away......

 

I have no idea what that means, just accept it on faith alone!

 

Sometimes we get off on tangents and just can’t get over our bad self’s. Some time ago I decided to develop the ultimate find. You know, enter your search into one field that performs a find in many. Well, I finely accomplished the task, but if you would have seen some of the stuff I did to get me there you’d take one look and think “Oh my God, this man needs professional help.

 

Anyway, I’m happy it worked out for you and Ender’s download was good wasn’t it. It makes you wonder who did it for him?

 

Harry

Link to comment
Share on other sites

I know you are asking about sorting records directly, rather than in a portal, but as that may be where you want to go next...

Go to the downloads page on my web site and download "The Kitchen Sink Too". It is free and will give you total control over sorting portals: multiple columns, multiple directions, anything you want.

Have fun.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...

Important Information

Terms of Use