August 7, 201015 yr Newbies How do I go about changing the order of line items in an invoice? Let say you start adding items to the invoice and you you suddenly want to move line #3 to the top instead. If you only have 5 lines then you can just delete everything and retype them but what if you have 30 items? Is there an easier way to move line #27 to go under line #4? The only possible method I can think of is to add an autogenerated number field "sortOrder" and auto sort the portal by that field. To change the order of the line items, you would just change the number in the sortOrder field. But this complicates the process a bit for the end-user because a decimal has to be used in order to not change the order of other line items. For example: If you want to move line item #22 to line #7, you would have to enter 6.x in the sortOrder field for line item #22 so that it sits below line #6 and above the original line #7. But the original line #7 is now line #8 but the sortOrder field reads 7. Original line #8 is now #9 and the sortOrder field reads 8. This should work but it might be confusing for the users to see the lines not matching up with the sortOrder fields. Is it possible to make a set of up/down arrows to the left of each line that will run a script. When you click on Up on line #22, the script will change the sortOrder field to 21 for line #22 then change the sortOrder field of line #21 to 22. If you click on Down on line #22, the script will change the sortOrder field to 23 for line #22 then change the sortOrder field of line #23 to 22. I might just be going at this the wrong way so any suggestion is greatly appreciated!
August 7, 201015 yr Is it possible to make a set of up/down arrows to the left of each line that will run a script. When you click on Up on line #22, the script will change the sortOrder field to 21 for line #22 then change the sortOrder field of line #21 to 22. Actually, the script should swap the values since the lines may have been already moved. It's not very difficult - basically you (1) store the source line's ordinal in a variable, (2) go to the target line, (3) store it's ordinal in another variable, (4) set the target's ordinal to the first variable, (5) return to the source line and (6) set its ordinal to the second variable. See also the Portal Line Shift demo here: http://www.excelisys.com/demos-free-filemaker-pro-downloads.php Note that this method changes the order permanently for all users - and it requires records not to be locked by another user.
August 9, 201015 yr Author Newbies See also the Portal Line Shift demo here: http://www.excelisys.com/demos-free-filemaker-pro-downloads.php Note that this method changes the order permanently for all users - and it requires records not to be locked by another user. Thank is exactly what I'm looking for! Thank you very much.
Create an account or sign in to comment