Newbies wyldlan Posted May 21, 2008 Newbies Posted May 21, 2008 New Member. Have been using Filemaker for ages and now am starting to get a bit more advanced. I have been developing a database and it is a main file that allows the creation of portals rows in a related table. Each record in the reference table auto enters a incremental number. The portal is then sorted by this number. I am trying to find a way of changing the sort order i.e. moving records up and down in the portal by swapping the previous records unique number with the one after or before thereby swapping the order up or down. Have tried and tried and not got anywhere and am now asking for help. thanks Duncan
bcooney Posted May 21, 2008 Posted May 21, 2008 Don't mess with the key fields (the unique ID of the record in the portal). Rather, create a field "SortOrder" and use that. Allow the user access to it. Set the portal sort to use that field.
Newbies wyldlan Posted May 22, 2008 Author Newbies Posted May 22, 2008 Thanks for the advice however there must be a way of moving a record up or down inside a portal. I am happy to keep the unique ID for the record and create another. My problem is a script that swapps the value in record one for the value in record two and by doing so reorders inside the portal.
bcooney Posted May 22, 2008 Posted May 22, 2008 You cannot drag and drop if that's what you are referring to. You may wish to check out Matt Petrowsky's site, as he has many technique files regarding portals. Click the link at the top of this page for FileMakerMagazine.com
comment Posted May 22, 2008 Posted May 22, 2008 It's possible, just a little tricky. You need to do this in the child table, so that you can get back to the record being moved without losing your place on account of portal resorting. Start with Go To Related Record [show related records only] and store the child record's rank into a variable. Then go to the next/previous record and swap the ranks. Return to the original record and replace the rank. That's only a rough outline - you need to watch out for some gotchas, like trying to move the first portal row up.
Recommended Posts
This topic is 6086 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 accountSign in
Already have an account? Sign in here.
Sign In Now