Need help on How to sort the result of the column with Expression?
Below is a drop down list of the company, with Code - Company Name, currently the code is the one sorted in ascending order
the code - company is column with expression because we put a hypen (-), I tried to add an order by in the expression but i got unknown error.
I tried to sort the column company but the drop down didn't sort out, it only sort the list of the company.
Could anyone help how to sort the company name instead of a code name in the dropdown list
Thank you in advance
Best answer by Mark_Plaggenborg
@Jheng I’ll try to make it a bit more clear with an example. I am using slightly adapted column names to prevent misinterpreting the purpose of them in your exact situation.
On this same table you also set the “Sort”: - company_name
Now you have another entity like a View/Table where you have a value where you wish to select a company. On this entity you have set a Reference (lookup) that is referring to table company (company_id = company_id).
So when you go to this entity (not table “Company”) and go that specific column where you need to select the company under “Subjects” → “Columns” → “Lookup”, you should see that it has the setting you need and maybe need to change at this point.
On the lookup table or view you set the “Sort” on “Company name” as per example. On the table/view you have the column with a lookup, make sure the “lookup control’ is set to “Combo (sorted)”, so not “Combo (alphabetical)”
Subject → Columns → Look-up
This can be set under “Subjects” - > “Columns” → “Look-up”
This is for the specific case. If you always want to this way whenever you are going to enable another lookup to that table/view, make it the same on the “Settings” of the lookup table/view.
The Company field in your end product has a look-up reference, presumably to the table Company. That look-up reference has a Look-up control which I think is Combo (Alphabetical) at the moment.
To ensure the combobox is sorted on company_name_1, the subject targeted in the reference should have the sorting based on this column, and the look-up control should be set to Combo (sorted).
@Jheng I’ll try to make it a bit more clear with an example. I am using slightly adapted column names to prevent misinterpreting the purpose of them in your exact situation.
On this same table you also set the “Sort”: - company_name
Now you have another entity like a View/Table where you have a value where you wish to select a company. On this entity you have set a Reference (lookup) that is referring to table company (company_id = company_id).
So when you go to this entity (not table “Company”) and go that specific column where you need to select the company under “Subjects” → “Columns” → “Lookup”, you should see that it has the setting you need and maybe need to change at this point.
Thank you so much! it works now, your guide really help me find where to update the sorting, i forgot that there's another reference table
Basically, I update only 2 things.
The other reference table (not table “Company”) here is where I have to update the lookup to Def. control: Combo (sorted) under “Subjects” → “Columns” → “Lookup”
In company table I only have to change the Sort order to ascending to the company_name column.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.