Jump to content
Sign in to follow this  
trmupstage

Sorting not working - why?

Recommended Posts

Hi,

I have an issue where sorting does not appear to work, either as a script or manually. Let me explain. I have an inventory table, line item table and a purchase order table. The purchase order layout has a portal to the line item table. The relationship from purchase orders to line items and inventory to line items works fine. I can add parts to the purchase order and adjust stock with the purchase orders. In the purchase order layout, I want to create buttons on the labels above the portal to sort the portal records by the label. Seems simple enough, but I can't get it to sort. Even if I go to sort, select the LineItem::Description field as the sort to field, select ascending, and press sort; nothing happens. Well, I take that back. The screen does "blip", but the sort doesn't happen.

I must be missing something obvious, but I can't think what it might be. Help...

Share this post


Link to post
Share on other sites

Go to http://www.databasepros.com and click on Resources. Search for portal sort. There are several techniques.

Share this post


Link to post
Share on other sites

Thanks for the link. I found an article and example on there. From reviewing the example file, I see that it is not as straight forward as I thought it would be. The example I found uses a calculation in the sort setup of the portal. I was thinking that maybe there was a simple script. Possibly not. I'll keep searching.

Share this post


Link to post
Share on other sites

"I was thinking that maybe there was a simple script. Possibly not. I'll keep searching."

Sure, keep searching... but you won't find a "simple script" to do it because you need to change the sort order of the *relationship* to change the sort order of the records in the portal.

Barbara posted a link to one of the simplest methods (even if it looks complicated). Another method is to use tab controls to switch between tabs, where each tab has a portal with the required sort order defined. Or use multiple layouts instead of tabs.

Share this post


Link to post
Share on other sites

Barbara posted a link to one of the simplest methods (even if it looks complicated). Another method is to use tab controls to switch between tabs, where each tab has a portal with the required sort order defined.

I don't see a link to any specific method. AFAIK, the ONLY simple method is to use multiple portals in a tab control. It is also the fastest. Any calculated approach has to deal with different data types - and that's anything but simple.

Share this post


Link to post
Share on other sites

"I was thinking that maybe there was a simple script. Possibly not. I'll keep searching."

Sure, keep searching... but you won't find a "simple script" to do it because you need to change the sort order of the *relationship* to change the sort order of the records in the portal.

Barbara posted a link to one of the simplest methods (even if it looks complicated). Another method is to use tab controls to switch between tabs, where each tab has a portal with the required sort order defined. Or use multiple layouts instead of tabs.

Sorry, I didn't mean to imply that I was getting a poor solution from Barbara. I am grateful for all the help I'm getting. There have been a few things in FM that I think must be easier to do than they appear. It's not that they are overly complicated, it's just that I wasn't understanding some of the structures used in FM well enough. Once I finally get the principal down, it all comes much easier.

Thanks again for the help.

Share this post


Link to post
Share on other sites

I thought I had linked to JMO's portal sort solutions. He had several. I see that you can't link to a page, so go to Resources and search on Portal Sorts.

I don't think you change the relationship sort, Vaughan, just the contents of the field that the portal is sorting. So, the portal always sorts by SortFieldAsc then SortFieldDesc, and via script, you populate those fields.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.