Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Change the order of line items in an invoice


This topic is 5220 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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!

Posted

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.

  • Newbies
Posted

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.

This topic is 5220 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.