Solved

Filemaker record reorder popup

Posted on 2014-11-06
2
415 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 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

617 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