Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Filemaker record reorder popup

Posted on 2014-11-06
2
Medium Priority
?
430 Views
Last Modified: 2014-11-07
Hi,

I have a list of projects in a single table each of which has a UID serial number field and separate numerical sort order field.

Wondering if there is a way to display the list in a layout or portal and allow user to select any item in the list,  and move it up or down the list order,  updating the 'sort order'  field with its new position.  

The purpose is to be able to create custom sort order for report layout.

Any pointers much appreciated..
0
Comment
Question by:Ringah
2 Comments
 
LVL 25

Accepted Solution

by:
Will Loving earned 2000 total points
ID: 40427845
I'm sure there are a number of ways this could be done so I'll just suggest one that I used here recently. In the portal row, I have two arrow buttons, one pointing up and one pointing down. Each button is attached to the same script called simply "Move Row Up/Down". The "Up" arrow button has "Up" as a script parameter, the "Down" arrow button has "Down" as the parameter.

The script looks like this:

If [ Get(ScriptParameter) = "Up" ]
#
#Already First Row
   If [ Get ( ActivePortalRowNumber ) = 1 ]
      Beep
      Exit Script [ ]
   End If
   #
   #Move Up One
   Set Field[ SetItem::Order ; SetItem::Order - 1 ]
   Go to Portal Row [ Previous ]
   Set Field[ SetItem::Order ; SetItem::Order + 1 ]
   #
Else
   #
   #Already Last Row
   If [ Get ( ActivePortalRowNumber ) = Count( SetItem::zk_SetItem_ID )
      Beep
      Exit Script [ ]
   End If
   #
   #Move Down One
   Set Field[ SetItem::Order ; SetItem::Order + 1 ]
  Go to Portal Row [ Next ]
  Set Field[ SetItem::Order ; SetItem::Order - 1 ]
   #
End If

My actual script includes an additional option if the ALT/Option key is held down that moves the row to the top or bottom of the list. The one for moving to the top is:

If [ Get ( ActiveModifierKeys ) = 8 ]
   Set Field [ SetItem::Order ; 0 ]
   Commit Records/Requests [ Skip data entry validation ; No dialog]
   Refresh Window [ ]
   Perform Script [ "Renumber Set" ]
End If

The sub-script at the end resets the Order field back to the actual number of the Portal row.
0
 

Author Comment

by:Ringah
ID: 40427956
Hi Will, this works perfectly particularly so as method compatible with the legacy data imported, very much appreciated...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
How much do you know about the future of data centers? If you're like 50% of organizations, then it's probably not enough. Read on to get up to speed on this emerging field.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question