AnsweredAssumed Answered

Change and retain the order of records in a Layout

Question asked by ricklhamilton_1 on Aug 24, 2009
Latest reply on Aug 25, 2009 by ricklhamilton_1


Change and retain the order of records in a Layout


This question may be a bit complex for a forum dialog - but the forum has been great support already so here goes:  :)


The situation and Problem:


I'm building an app that automates the creation, editing and printing of Airplane checklists. The construct of the data is simple


Checklist  -----> ChecklistArea------>Checklist task item


preflight -------> Cockpit ----------> Item 1

                                                     Item 2 and so on.


In the table checklistTask:


checklistID  (number)

checklistAreaID (number)

taskSequence  (number)

taskItem   (Item to do)  (Text)

taskCompletion (type of complete..CHECK,ON OFF etc) (Text)


Within each combo of Checklist and Checklist area the sequence [taskSequence]of the detailed item is of utmost importance to the flow.


I want to build a Layout that allows the user; first see how the tasks are sequenced. (Easy enough). But I want them to be able to move items UP or Down in the sequence and then "commit" that change to the database.That would mean finding an elegant way to mass update the taskSequence number value based on how the user has moved items up or down in the list. 


For now - I have a simple Layout that uses a portal to show the checkListTask item in the order set in the taskSequence field. But I doubt the Portal object has the capability to move items up or down in a list - Only to sort them. 


The hacky way to do this is to add a new temp field and allow the user to enter numeric values into that to represent the new sequence. But there are too many items to make that practical...I'd like for them to be able to highlight an item and then click an up or down button to move it ahead or behind where it sits today.


 The question:


 I don't need someone to write a white paper in the forum on how to do this. Just maybe point me in the direction of an existing example or reference a Layout Object that may help me create this capability or identify a template where this exists. My guess is that I will need to make some changes to the table structure as well - I'm OK with that too...