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

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

Recommended Posts

  • Newbies
Posted

2nd time around using FM. Last time was before Claris owned the product. But trying to create a display in a list view that could be used in other solutions I am creating. Did a bunch of searches here in the forum trying to find what I assume is a simple answer. Tore apart all the examples I could find that came with 8.5. Looking for a direction to go down and hopefully I can figure it out my self from there. Example, 102 sales reps with all kinds of other data we track other then address and phone number. One being sales year to date. Looking for away to show top sales people on a list view, which allows for the layout we want vs tables, and easy return to I think it is called the GTRR (or base record) link to sales reps website, email addy etc from the list view. Layout and things I don't think are possible in preview mode per the docs and examples I have studied. Showing all 102 sales reps works and the links tested etc. But need to be able to just list the top 10 on one page and then if possible have a forward button to relist with records for the sales amount sort for records 11 to 20, etc. I have been looking at the Gets, Goto Record request page etc. I assume I need a script that sorts the records based on sales and starts at the first record, which it currently does (but listing all 102 sales reps). What I need to figure out is the scheme to stop the record count display at a max of 10 records per page. My old programing days wants me to look for a way to put a counter in there and a if X=10 then do this else keep going. But that doesn't seem like the right approach in FM. I studied the product catalog example that came with 8.5 which does something like this with it's thumb nails view and the cut and paste and global variables and transparent buttons sitting on top of the images. I assume there has to be away to do what I want vs doing it with that approach. If somebody could point me at the section of the docs or online help to study to understand the concept explained above it would be much appreciated. TIA

Posted

You could do this by sorting the records, looking at the 1st 10, by omitting the rest, then showing them all again, sorting again, then omitting 10, going to the 10th record, omitting the rest, ditto...

Or Replacing in all records, with a calculation to mark every 10 records as the same thing, then use that number for Finds or a portal.

Both of which would work, but are clunky, esp. from an interface point of view. Since you want only 10, of sorted records, I think I'd go with a portal. You could do this various ways, Copy All Records.

But someone posted a brilliant example here. Unfortunately they didn't put their name anywhere, and I may have changed the name of the file so that I could find it easier; so I can't point you to it; so I'll repost it, with the addition of sorting the relationships. (I also seldom include my name on example files, but I can see that can be a problem.) If it's your file please forgive me, and chime in and tell us.

It uses the functionality of a repeating field, combined with GetNthRecord, pretty advanced thinking, but easy enough to implement.

You would need to sort by the number of sales per Salesperson, or whatever you're using. You might consider running a short script first, to put that relational total into a fixed number field. This would add a few seconds possibly to the beginning of viewing, but would make the portal much much faster. The script would have to run when you went to the layout however, to keep the numbers current.

ScrollPortal8_sort.fp7.zip

  • Newbies
Posted

Thanks for the quick reply, I will mess with your example in a minute

This morning looking at examples and the 8.5 Bible (it is Sunday right ??? )

in a nutshell with out going into all the code I got a hack to give me the first page (records 1 to 10)

I sorted the records on the sales numbers

then...

Go to Record/Request/Page [First]

loop

replace field contents [no dialog sales_db::list_view_rec_num; Serial numbers]

go to Record/Request/Page [Next; Exit after last]

end loop

perform find [Restore]

What I did was create a numeric field named list_view_rec_num and populate it with a serial number in increments of 1 from a sales data sort, then do another sort and find all records whose serial number was equal to or less then 10.

Keep in mind I am still messing around as I get the top 10 sales people listed, but appears on the surface FM is breaking or losing track of the original sort as a result of writing all the records again. If I sorted on the list_view_record_num and tried to get a second page showing 11 to 20, then that will probably not work. But again this is play day right now and I am still experimenting with test data.

After all this time from my early experience with FM, I can't believe they don't give you better record number manipulation and sorting control.

Posted

Replace acts on all the records of the found set. So you normally wouldn't use it inside a Loop. You would use Replace just by itself.

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