18
Views
8
Comments
Solved
Combobox sort
Question

Hello,

So I found Documentation about Combobox sorting, but when I sort entity by id, it still shows data sorted by names. Can you tell me why and what should I do?

mvp_badge
MVP
Rank: #2
Solution

Hi Gigi,

If you use an Entity as Source Entity of a Combo Box, it will sort the list according to the Order By Attribute of the Entity. If there's no Order By Attribute defined, it will sort based on Id.

However, if you specify the output of an Aggregate or SQL as Source Record List, the order that list has is maintained. Without seeing your code I cannot tell what exactly the problem is, but I would guess that you don't actually use the Aggregate output as Source Record List.

Rank: #50689

Kilian Hekhuis wrote:

Hi Gigi,

If you use an Entity as Source Entity of a Combo Box, it will sort the list according to the Order By Attribute of the Entity. If there's no Order By Attribute defined, it will sort based on Id.

However, if you specify the output of an Aggregate or SQL as Source Record List, the order that list has is maintained. Without seeing your code I cannot tell what exactly the problem is, but I would guess that you don't actually use the Aggregate output as Source Record List.

 I do have this but it does not work. I create City aggregate in preparation but order is still by name

 

mvp_badge
MVP
Rank: #72

Hi Gigi,

I checked the mentioned requirement and for me it's working as expected, Could you please remove all the defined sorting statement from the Aggregate sort tab and re-define the sort statement manually and check once

Hope this helps you!


Regards,

Benjith Sam

mvp_badge
MVP
Rank: #2
Solution

Hi Gigi,

If you use an Entity as Source Entity of a Combo Box, it will sort the list according to the Order By Attribute of the Entity. If there's no Order By Attribute defined, it will sort based on Id.

However, if you specify the output of an Aggregate or SQL as Source Record List, the order that list has is maintained. Without seeing your code I cannot tell what exactly the problem is, but I would guess that you don't actually use the Aggregate output as Source Record List.

Rank: #50689

Kilian Hekhuis wrote:

Hi Gigi,

If you use an Entity as Source Entity of a Combo Box, it will sort the list according to the Order By Attribute of the Entity. If there's no Order By Attribute defined, it will sort based on Id.

However, if you specify the output of an Aggregate or SQL as Source Record List, the order that list has is maintained. Without seeing your code I cannot tell what exactly the problem is, but I would guess that you don't actually use the Aggregate output as Source Record List.

 I do have this but it does not work. I create City aggregate in preparation but order is still by name

 

mvp_badge
MVP
Rank: #2

Can you share the Module so I can take a look?

Rank: #50689

Kilian Hekhuis wrote:

Can you share the Module so I can take a look?

 I am new in Outsystems so could you tell me how to share module?


 

Rank: #50689

Oh no sorry it works quite well, I thought I should've sort in Entity. I misunderstood  the idea but now I get it.

Thanks for help. I love this community

mvp_badge
MVP
Rank: #72

Gigi Tsirekidze wrote:

Oh no sorry it works quite well, I thought I should've sort in Entity. I misunderstood  the idea but now I get it.

Thanks for help. I love this community

You are welcome, Gigi :)

Glad you got it solved!


Kind Regards,

Benjith Sam

mvp_badge
MVP
Rank: #2

Gigi Tsirekidze wrote:

Oh no sorry it works quite well, I thought I should've sort in Entity. I misunderstood  the idea but now I get it.

Thanks for help. I love this community

 Glad you got it solved! As for your question of how to share a Module, in case you need it in the future, you press Ctrl-S and save it, then below your post below "Attachment" click "Choose File" and select the file you saved.