?
Solved

Filemaker record reorder popup

Posted on 2014-11-06
2
Medium Priority
?
425 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

718 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