Jump to content

Portal Sorting Problem


shellbz

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

Recommended Posts

  • Newbies
We have a portal in a layout for scanning in items for wholesale invoices, displaying records from another layout 'Wholesale Line Items'.  Everything runs smoothly when scanning and entering items.  A sorted packing list is printed, and we use this physical copy to pack the goods in boxes for customers.  Many times, it would inevitably be necessary to change the item numbers of some items on the packing sheet, as we do not have some of them in stock and other items are substituted.
 
For example, we scanned in the following items:
 
Item No.                   Description        
32249                   Remote Control
01207                   Coloring Book
12745                   Craft Sticks
40523                   Plastic Eggs
RE-4002 Sports Watch
 
The sort script is imbedded in the Print button for the packing list so the list prints as follows:
 
01207
12745
32249
40523
RE-4002
 
Let's say # 12745 craft sticks is out of stock, so we replace it with # 48752  (another type of) craft sticks.
 
So the list becomes:
 
01207
48752
32249
40523
RE-4002
 
We would like to maintain it in this last order, without resorting.  How can this be done?  
 
So, basically, we would like to have the first list sorted, but not the second list after we've made changes.
 
We're using Filemaker 8.5 in Windows XP.  Any help would be appreciated.  Thanks.
Link to comment
Share on other sites

The sort script is imbedded in the Print button for the packing list

 

So how is this a "portal sorting problem"?

 

 

We would like to maintain it in this last order, without resorting.  How can this be done?

 

 

Will they be clicking the same Print button again, after making the changes?

Link to comment
Share on other sites

  • Newbies

Because the tiems being sorted are in a portal, relating records from Wholesale Line Items.

 

The script for printing is imbedded in the button "packing list"

 

- Go to related record "Wholesale Line Items" using layout "Packing List"

- Sort item number - ascending, then sort description - ascending

 

So every time the "Packing List" button is clicked to print the packing list, all is automatically sorted by item number, then description.

 

This first packing list is used for us to use as a physical copy to pack the order.  So we would write in the packing box numbers as the items are packed.  But many times, some item numbers will be changed since they are out of stock.  

 

The bottom line is that we want to keep this original list of sorted packing list.  But when we change numbers in between, we don't want everything to re-sort.  Yes, we are using the same print button, so every thing gets re-sorted.

 

How can I set separate sort & print scripts to sort when we want, and print as is when we don't want it re-sorted?

 

Thanks for your time.

Link to comment
Share on other sites

Because the tiems being sorted are in a portal, relating records from Wholesale Line Items.

 

Ahm no, they are not in a portal when you sort them. A portal has a sort order of its own, and it's unaffected by any sort you perform in the child table.

 

The other thing is, you must understand that records are never sorted permanently. Records are always ordered by creation order first, then sorted as requested. So basically, you have two possible approaches here:

 

1. Record the change by entering the replacement item's number into a separate field. In fact, I am surprised you don't do this already for another reason: don't you need to record what was the originally requested item, and the fact that a substitution was made?

 

2. Have your script branch and do a separate thing on first run, something like:

If [ not Invoices::Printed ]
Set Field [ Invoices::Printed; Get (CurrentTimestamp) ]
Go to Related Record [ LineItems ]
# SORT BY ITEM NUMBER
Sort Records [ Restore ]
Replace Field Contents [ LineItems::SortOrder; Replace with serial numbers:...]
Else
Go to Related Record [ LineItems ]
# SORT BY SortOrder FIELD
Sort Records [ Restore ]
End If
# THE REST OF THE SCRIPT
Link to comment
Share on other sites

  • Newbies

Thank you for your suggestions.  I'll work on it to see how this can be implemented.  

 

And to answer your question, no, we do not need to show the original requested item.  Our customers accept substitutions just fine.

Link to comment
Share on other sites

This topic is 3573 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.