Case
We have a business process that uses a "predecessor" (Order) field to indicate what task/row should be executed first. Our business process works except for the ordering function. The way we are ordering the predecessor field is by using "How to sort records?" Predecessor - Ascending:
My initial thought was that it would go to the Lookup object and order the records in the lookup by the Predecessor field, and then if the record matches the filter then it would pull the records specified in that order (and effectively creating tasks, one-by-one, in order).
Is there an obvious reason this is not working, or would I have to debug and just conduct trial and error? Am I misusing the "How to sort records" parameter or not understanding how Lookup feilds work?
Solution
In this particular situation, you have a case when one particular lookup record is being used only. And the reason is filtering, you have filtered the records by ID. Meaning, you will either find the record from lookup by ID or will have an error if the field is empty (no ID).
Basically, the "selection" you will get in this element is 1 record having ID that is selected somewhere in Design object.
For better understanding lets take Case as an example. The case has Assignee. If you read the object Case, then Contact with filter "id=Read Case.Id" you will find 1 Contact selected as Assignee. So you don't need to sort this one contact, right?
Sorting is used when you don't have any ID of the record. For example you want to read the last created Case. You don't have it's ID, so you just read the Case object, select any filter (ID exists) and then Sort it by Created On descending.