I have an interface where a supervisor can prioritize orders. Is there a way that when one order ships that the numbers will automatically change to a lower number?
Discussion posts and replies are publicly visible
Can you clarify your use case a bit? I'm unclear
So the interface is written so that the user can assign a priority number to an order. The second column is where they enter in the number and the third is what the current number is. Duplicate numbers only happen if an order has 2 or more line items as shown with number 4. I am hoping to figure out a way where when order is shipped and is no longer on the report as for what was number 5, that 6 would become 5.
AllenP said:I am hoping to figure out a way where when order is shipped and is no longer on the report as for what was number 5, that 6 would become 5.
This brings me back to the question from my first bullet point - what is the actual user interaction that precipitates this? Is it something they do on-form? Is it something that happens in an unrelated process model?
My apologize Mike, Yes in the form they enter or edit the number in the second column in an editable grid.
So entering / editing the number in the grid is what causes the order to be shipped?
It generates a "production order", the order that the items should be produced in.
But I'm thinking of your use case where the priority list is adjusted by "orders getting shipped". I understand that users can enter new numbers manually on the form, but that doesn't tell me what happens to call the "automatically adjust priorities" use case into play. Is it some other on-form user action? Or something that happens in the background, etc?
That is what I am attempting to perform, something where either they hit a button or in the background that looks for "missing numbers: for example in the picture "5" and will take "6" and make it "5" and so on.
In general, you would just need functionality that loops over the list of items (using a!forEach()), and for any item where the priority number is greater than X (where X is the priority number of the item that "shipped"), lower it by one. This doesn't handle the use case of duplicate priority numbers very well, though, which is why I asked initially about duplicates. It should handle gaps fine, it would just maintain the current gaps at their current distance (i.e. a jump from "5" to "9" would become a jump from "4" to "8").
Yea, sounds like this would be best done on the function that actually ships the order, where each lower priority order is "raised" by 1 (number lowered) once an order is shipped - one order at a time. Is there any SAIL code that can be shared around that? (I'm still not sure where that occurs in this use case...)
The logic for having a button on the form for users to manually click to re-prioritize can be done, but the logic is a little interesting with multiple similarly-prioritized rows and multiple possible gaps (2-3 orders ship before re-prioritizing) - and would not be my preferred solution.