At least two ways:
1) You can sort the relationship in the Relationships Graph.
2) You can substitute an ExecuteSQL ( ) query and use the ORDER BY clause instead of using List ( ).
#1 is easier, but it also means your relationship will be automatically sorted for all other calculation fields. To get around that problem, you can define another relationship (using a new Table Occurrence) for just this calculation, if you prefer.
You can do it in many ways. I have attached a solution file where you can find 3 option to do the task.
1) By Value List Method
Need to create a new calc field to find out the sort order which will used in the related value list for 2nd field on which the sorting will be apply.
2) By Relationship Sorting
Descending order by field percentage
3) By Execute SQL
ExecuteSQL ( "SELECT prod_INCI_name FROM FormulaItens " & "WHERE FormulaID = " & FormulaItens::gFormulaID & " ORDER BY Percentage DESC" ; "" ; ",") )
The 3rd one is only possible if you are using FM12.
Hope this will help you.
Software Developer, Mindfire Solutions, India
this resolved my issue.
I actually had to create a field in the joint table with the INCI name of the product table.
So I could use the the sort order in the relationsship graph.
Thank you (all) that have replied to my request.
woow. I resolved the issue using the sort order in the relationsship graph.
Since I wanted to show a field in the products table, I had to create a "pipeline" field in the joint table formula_itens with the INCI name of each product.
I will look aht the ExecuteSQL suggestion. This looks GREAT.... does not need a dedicated relatioship!!!
THANKS A LOT.. I just dug into SQL a bit... and this resolves a lot of my issues.
Great help file.