Solved

Filemaker record reorder popup

Posted on 2014-11-06
2
390 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 24

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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…
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now