30
Views
18
Comments
Solved
avoid sorting in static entity

Hi All

I am working on a reactive web application, I have a static entity and I need to display the record values in a dropdown. I have three values "Inbox, Archive and Physical Delivery". My dropdown has to be listed as "Inbox, Physical Delivery and Archive". But entity is sorted and my dropdown values are "Archive, Inbox and Physical Delivery". Is there a way to remove the sorting?

Solution

Hello Kavya,

I implemented a static entity as your and did the changes as I mentioned in my above post, It is working as expected. have a look on these screens :

After changing the order : 

Aggregate : 

(You can observe the ID's for its initial order)

Here is the result I got after changing order and adding sorting in aggregate :

There may be just one issue in your case, i.e. you might not have published your DB module if it is in another module. Otherwise it will definitely work.

If still issue persist, kindly post OML or screens of above things.


Thanks,

Sanjay



Hello Kavya,


I'm not sure about removing sorting from static entity but You can always change the order of your attributes in static entity. See below for Ex:

Let me know if solves your problem.

Regards,

Sanjay

Hi! 

Static entities normally have a field called "order". I suggest you use that field to order the list. 

Stay safe

Graça  

Hi Kavya,

      Kindly check if you have sorted by the order value as below given image:-

Regards,

Chockalingam Saravanan

Rank: #1342

Hi Kavya ,


You can set order value in static entity and apply sorting on order value.

i hope it will be helpful to you.


Thanks

Rahul Jain

setorderval.PNG

Hi Kavya,

    Could you share the oml ,So that we could identify the issue!


Regards,

Chockalingam Saravanan

kavya anbazagan

What is the content of the order field for your records? 

What is the value on that order field for each of your records in your static entity ?

Solution

Hello Kavya,

I implemented a static entity as your and did the changes as I mentioned in my above post, It is working as expected. have a look on these screens :

After changing the order : 

Aggregate : 

(You can observe the ID's for its initial order)

Here is the result I got after changing order and adding sorting in aggregate :

There may be just one issue in your case, i.e. you might not have published your DB module if it is in another module. Otherwise it will definitely work.

If still issue persist, kindly post OML or screens of above things.


Thanks,

Sanjay



mvp_badge
MVP
Rank: #2

Ok, there seems to be a lot of noise in this topic, while in fact it's pretty simple. If you specify a Static Entity as Source Entity instead of supplying a Source Record List, the Platform will query the Static Entity for you. If the Static Entity has an "Order By Attribute" defined, the Platform will sort by that Attribute, ascending. If you have created a Static Entity and didn't change the default Attributes, that will be the Order Attribute. If the Static Entity does not have an Order By Attribute specified, the Platform will not sort the list, but since it's a simple "SELECT * FROM MyEntity", both MS SQL and Oracle will return the results sorted by Id.

That's it. There's no need to create an Aggregate that sorts by Order, as long as you have Order set as Order By Attribute.


EDIT: In Reactive, there is no 'Source Entity', but if you create an Aggregate by dragging the Entity, it'll automatically include a sort on the Order By Attribute.